MySQL Forums
Forum List  »  Merge Storage Engine

Re: MERGE table index fails to contain all records
Posted by: Shane Bester
Date: February 17, 2007 11:12AM

ingo, yes, the base tables have "primary key" while the merge has "key". it's a huge difference... in fact new versions of mysql perform this check and refuse to open the merge table if it found a difference:

mysql> select * from testm;
ERROR 1168 (HY000): Unable to open underlying table which is differently defined or of non-MyISAM type or doesn't exist

So, this works 100%
----------------
flush tables;
drop table if exists test1;
drop table if exists test2;
drop table if exists testm;
create table test1 (id integer primary key);
create table test2 (id integer primary key);
create table testm (id integer, primary key(id)) engine=merge union=(test1,test2);
insert into test1 values (1),(2),(3);
insert into test2 values (4),(5),(6);
select * from testm;
select * from testm where id=2;
select * from testm where id<5;

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: MERGE table index fails to contain all records
5474
February 17, 2007 11:12AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.