summaryrefslogtreecommitdiff
path: root/mysql-test/t/union.test
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2004-02-17 01:52:33 +0200
committerunknown <bell@sanja.is.com.ua>2004-02-17 01:52:33 +0200
commit7b6b03f340320c60ab3d14e30814c05680f692ed (patch)
tree774c48a5f290d9837d859f1703fb2e9a8953733b /mysql-test/t/union.test
parent709356d47343af2951cdcd02419c71fc49c35f85 (diff)
parent271b11b3d902996ff518bb3741bb62e70c97029e (diff)
downloadmariadb-git-7b6b03f340320c60ab3d14e30814c05680f692ed.tar.gz
merge
sql/mysql_priv.h: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_insert.cc: Auto merged sql/sql_lex.cc: Auto merged sql/sql_load.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_update.cc: Auto merged
Diffstat (limited to 'mysql-test/t/union.test')
-rw-r--r--mysql-test/t/union.test10
1 files changed, 10 insertions, 0 deletions
diff --git a/mysql-test/t/union.test b/mysql-test/t/union.test
index 60963548eed..7d1818ab724 100644
--- a/mysql-test/t/union.test
+++ b/mysql-test/t/union.test
@@ -473,3 +473,13 @@ create table t1 ( RID int(11) not null default '0', IID int(11) not null def
insert into t1 ( RID,IID,nada,NAME,PHONE) values (1, 1, 'main', 'a', '111'), (2, 1, 'main', 'b', '222'), (3, 1, 'main', 'c', '333'), (4, 1, 'main', 'd', '444'), (5, 1, 'main', 'e', '555'), (6, 2, 'main', 'c', '333'), (7, 2, 'main', 'd', '454'), (8, 2, 'main', 'e', '555'), (9, 2, 'main', 'f', '666'), (10, 2, 'main', 'g', '777');
select A.NAME, A.PHONE, B.NAME, B.PHONE from t1 A left join t1 B on A.NAME = B.NAME and B.IID = 2 where A.IID = 1 and (A.PHONE <> B.PHONE or B.NAME is null) union select A.NAME, A.PHONE, B.NAME, B.PHONE from t1 B left join t1 A on B.NAME = A.NAME and A.IID = 1 where B.IID = 2 and (A.PHONE <> B.PHONE or A.NAME is null);
drop table t1;
+#
+# Bug #2809 (UNION fails on MyIsam tables when index on second column from
+# same table)
+#
+create table t1 (col1 tinyint unsigned, col2 tinyint unsigned);
+insert into t1 values (1,2),(3,4),(5,6),(7,8),(9,10);
+select col1 n from t1 union select col2 n from t1 order by n;
+alter table t1 add index myindex (col2);
+select col1 n from t1 union select col2 n from t1 order by n;
+drop table t1;