summaryrefslogtreecommitdiff
path: root/mysql-test/t/union.test
diff options
context:
space:
mode:
authorbell@sanja.is.com.ua <>2004-02-17 01:52:33 +0200
committerbell@sanja.is.com.ua <>2004-02-17 01:52:33 +0200
commitf4d1ee971bfa4ebdcea76cba4f8e0d4d7c17dc52 (patch)
tree774c48a5f290d9837d859f1703fb2e9a8953733b /mysql-test/t/union.test
parente9315f984d9224044e771b5c483050a81b03b947 (diff)
parente6de937e0d4ff4607e184cc47bb73b9d1e6e367f (diff)
downloadmariadb-git-f4d1ee971bfa4ebdcea76cba4f8e0d4d7c17dc52.tar.gz
merge
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;