diff options
Diffstat (limited to 'mysql-test/t/union.test')
-rw-r--r-- | mysql-test/t/union.test | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test index b46f54c5c41..af2dd154974 100644 --- a/mysql-test/t/union.test +++ b/mysql-test/t/union.test @@ -107,3 +107,20 @@ drop table t1,t2; --error 1096 select * union select 1; select 1 as a,(select a union select a); +--disable_warnings +drop table if exists t1,t2; +--enable_warnings +CREATE TABLE t1 ( id int(3) unsigned default '0') TYPE=MyISAM; +INSERT INTO t1 (id) VALUES("1"); +CREATE TABLE t2 ( id int(3) unsigned default '0', id_master int(5) default '0', text1 varchar(5) default NULL, text2 varchar(5) default NULL) TYPE=MyISAM; +INSERT INTO t2 (id, id_master, text1, text2) VALUES("1", "1", +"foo1", "bar1"); +INSERT INTO t2 (id, id_master, text1, text2) VALUES("2", "1", +"foo2", "bar2"); +INSERT INTO t2 (id, id_master, text1, text2) VALUES("3", "1", NULL, +"bar3"); +INSERT INTO t2 (id, id_master, text1, text2) VALUES("4", "1", +"foo4", "bar4"); +SELECT 1 AS id_master, 1 AS id, NULL AS text1, 'ABCDE' AS text2 UNION SELECT id_master, t2.id, text1, text2 FROM t1 LEFT JOIN t2 ON t1.id = t2.id_master; +SELECT 1 AS id_master, 1 AS id, 'ABCDE' AS text1, 'ABCDE' AS text2 UNION SELECT id_master, t2.id, text1, text2 FROM t1 LEFT JOIN t2 ON t1.id = t2.id_master; +drop table if exists t1,t2; |