miguel@txg:~$ dbs/5.0/bin/mysql -uroot Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2 Server version: 5.0.82-debug Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> -- original test case with primary key mysql> drop database if exists db1; Query OK, 4 rows affected (0.01 sec) mysql> create database db1; Query OK, 1 row affected (0.00 sec) mysql> use db1 Database changed mysql> create table foo (id int primary key, mystring char(25)) ENGINE=MyISAM; Query OK, 0 rows affected (0.02 sec) mysql> create table bar (id int primary key, mystring char(25)) ENGINE=MyISAM; Query OK, 0 rows affected (0.02 sec) mysql> create table baz (id int primary key, mystring char(25)) ENGINE=MyISAM; Query OK, 0 rows affected (0.01 sec) mysql> insert into foo values (1, 'foo'); Query OK, 1 row affected (0.00 sec) mysql> insert into bar values (1, 'bar'); Query OK, 1 row affected (0.01 sec) mysql> insert into baz values (1, 'baz'); Query OK, 1 row affected (0.00 sec) mysql> create table qux (id int primary key, mystring char(25)) ENGINE=MRG_MyISAM -> UNION=(foo,bar,baz); Query OK, 0 rows affected (0.01 sec) mysql> select distinct id from qux; +----+ | id | +----+ | 1 | | 1 | | 1 | +----+ 3 rows in set (0.00 sec) mysql> mysql> -- test case without primary key mysql> drop database if exists db1; Query OK, 4 rows affected (0.01 sec) mysql> create database db1; Query OK, 1 row affected (0.00 sec) mysql> use db1 Database changed mysql> create table foo (id int, mystring char(25)) ENGINE=MyISAM; Query OK, 0 rows affected (0.14 sec) mysql> create table bar (id int, mystring char(25)) ENGINE=MyISAM; Query OK, 0 rows affected (0.06 sec) mysql> create table baz (id int, mystring char(25)) ENGINE=MyISAM; Query OK, 0 rows affected (0.04 sec) mysql> insert into foo values (1, 'foo'); Query OK, 1 row affected (0.00 sec) mysql> insert into bar values (1, 'bar'); Query OK, 1 row affected (0.00 sec) mysql> insert into baz values (1, 'baz'); Query OK, 1 row affected (0.01 sec) mysql> create table qux (id int, mystring char(25)) ENGINE=MRG_MyISAM -> UNION=(foo,bar,baz); Query OK, 0 rows affected (0.03 sec) mysql> select distinct id from qux; +------+ | id | +------+ | 1 | +------+ 1 row in set (0.00 sec) Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 5.1.35-debug Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> -- original test case with primary key mysql> drop database if exists db1; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> create database db1; Query OK, 1 row affected (0.00 sec) mysql> use db1 Database changed mysql> create table foo (id int primary key, mystring char(25)) ENGINE=MyISAM; Query OK, 0 rows affected (0.03 sec) mysql> create table bar (id int primary key, mystring char(25)) ENGINE=MyISAM; Query OK, 0 rows affected (0.02 sec) mysql> create table baz (id int primary key, mystring char(25)) ENGINE=MyISAM; Query OK, 0 rows affected (0.01 sec) mysql> insert into foo values (1, 'foo'); Query OK, 1 row affected (0.00 sec) mysql> insert into bar values (1, 'bar'); Query OK, 1 row affected (0.00 sec) mysql> insert into baz values (1, 'baz'); Query OK, 1 row affected (0.01 sec) mysql> create table qux (id int primary key, mystring char(25)) ENGINE=MRG_MyISAM -> UNION=(foo,bar,baz); Query OK, 0 rows affected (0.03 sec) mysql> select distinct id from qux; +----+ | id | +----+ | 1 | | 1 | | 1 | +----+ 3 rows in set (0.00 sec) mysql> mysql> -- test case without primary key mysql> drop database if exists db1; Query OK, 4 rows affected (0.04 sec) mysql> create database db1; Query OK, 1 row affected (0.00 sec) mysql> use db1 Database changed mysql> create table foo (id int, mystring char(25)) ENGINE=MyISAM; Query OK, 0 rows affected (0.02 sec) mysql> create table bar (id int, mystring char(25)) ENGINE=MyISAM; Query OK, 0 rows affected (0.02 sec) mysql> create table baz (id int, mystring char(25)) ENGINE=MyISAM; Query OK, 0 rows affected (0.02 sec) mysql> insert into foo values (1, 'foo'); Query OK, 1 row affected (0.00 sec) mysql> insert into bar values (1, 'bar'); Query OK, 1 row affected (0.00 sec) mysql> insert into baz values (1, 'baz'); Query OK, 1 row affected (0.01 sec) mysql> create table qux (id int, mystring char(25)) ENGINE=MRG_MyISAM -> UNION=(foo,bar,baz); Query OK, 0 rows affected (0.03 sec) mysql> select distinct id from qux; +------+ | id | +------+ | 1 | +------+ 1 row in set (0.01 sec) Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 Server version: 6.0.11-alpha-debug Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> -- original test case with primary key mysql> drop database if exists db1; Query OK, 0 rows affected, 1 warning (0.00 sec) mysql> create database db1; Query OK, 1 row affected (0.00 sec) mysql> use db1 Database changed mysql> create table foo (id int primary key, mystring char(25)) ENGINE=MyISAM; Query OK, 0 rows affected (0.14 sec) mysql> create table bar (id int primary key, mystring char(25)) ENGINE=MyISAM; Query OK, 0 rows affected (0.09 sec) mysql> create table baz (id int primary key, mystring char(25)) ENGINE=MyISAM; Query OK, 0 rows affected (0.02 sec) mysql> insert into foo values (1, 'foo'); Query OK, 1 row affected (0.01 sec) mysql> insert into bar values (1, 'bar'); Query OK, 1 row affected (0.00 sec) mysql> insert into baz values (1, 'baz'); Query OK, 1 row affected (0.01 sec) mysql> create table qux (id int primary key, mystring char(25)) ENGINE=MRG_MyISAM -> UNION=(foo,bar,baz); Query OK, 0 rows affected (0.08 sec) mysql> select distinct id from qux; +----+ | id | +----+ | 1 | | 1 | | 1 | +----+ 3 rows in set (0.01 sec) mysql> mysql> -- test case without primary key mysql> drop database if exists db1; Query OK, 4 rows affected (0.08 sec) mysql> create database db1; Query OK, 1 row affected (0.00 sec) mysql> use db1 Database changed mysql> create table foo (id int, mystring char(25)) ENGINE=MyISAM; Query OK, 0 rows affected (0.04 sec) mysql> create table bar (id int, mystring char(25)) ENGINE=MyISAM; Query OK, 0 rows affected (0.05 sec) mysql> create table baz (id int, mystring char(25)) ENGINE=MyISAM; Query OK, 0 rows affected (0.01 sec) mysql> insert into foo values (1, 'foo'); Query OK, 1 row affected (0.00 sec) mysql> insert into bar values (1, 'bar'); Query OK, 1 row affected (0.01 sec) mysql> insert into baz values (1, 'baz'); Query OK, 1 row affected (0.01 sec) mysql> create table qux (id int, mystring char(25)) ENGINE=MRG_MyISAM -> UNION=(foo,bar,baz); Query OK, 0 rows affected (0.03 sec) mysql> select distinct id from qux; +------+ | id | +------+ | 1 | +------+ 1 row in set (0.00 sec) D:\mysql-4.1.22-win32>bin\mysql -uroot Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 1 to server version: 4.1.22-community Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> -- original test case with primary key mysql> drop database if exists db1; Query OK, 0 rows affected, 1 warning (0.04 sec) mysql> create database db1; Query OK, 1 row affected (0.05 sec) mysql> use db1 Database changed mysql> create table foo (id int primary key, mystring char(25)) ENGINE=MyISAM; Query OK, 0 rows affected (0.09 sec) mysql> create table bar (id int primary key, mystring char(25)) ENGINE=MyISAM; Query OK, 0 rows affected (0.07 sec) mysql> create table baz (id int primary key, mystring char(25)) ENGINE=MyISAM; Query OK, 0 rows affected (0.08 sec) mysql> insert into foo values (1, 'foo'); Query OK, 1 row affected (0.02 sec) mysql> insert into bar values (1, 'bar'); Query OK, 1 row affected (0.00 sec) mysql> insert into baz values (1, 'baz'); Query OK, 1 row affected (0.00 sec) mysql> create table qux (id int primary key, mystring char(25)) ENGINE=MRG_MyISAM -> UNION=(foo,bar,baz); Query OK, 0 rows affected (0.06 sec) mysql> select distinct id from qux; +----+ | id | +----+ | 1 | | 1 | | 1 | +----+ 3 rows in set (0.01 sec) mysql> mysql> -- test case without primary key mysql> drop database if exists db1; Query OK, 4 rows affected (0.15 sec) mysql> create database db1; Query OK, 1 row affected (0.01 sec) mysql> use db1 Database changed mysql> create table foo (id int, mystring char(25)) ENGINE=MyISAM; Query OK, 0 rows affected (0.13 sec) mysql> create table bar (id int, mystring char(25)) ENGINE=MyISAM; Query OK, 0 rows affected (0.05 sec) mysql> create table baz (id int, mystring char(25)) ENGINE=MyISAM; Query OK, 0 rows affected (0.09 sec) mysql> insert into foo values (1, 'foo'); Query OK, 1 row affected (0.00 sec) mysql> insert into bar values (1, 'bar'); Query OK, 1 row affected (0.00 sec) mysql> insert into baz values (1, 'baz'); Query OK, 1 row affected (0.00 sec) mysql> create table qux (id int, mystring char(25)) ENGINE=MRG_MyISAM -> UNION=(foo,bar,baz); Query OK, 0 rows affected (0.07 sec) mysql> select distinct id from qux; +------+ | id | +------+ | 1 | +------+ 1 row in set (0.02 sec)