diff options
author | sergefp@mysql.com <> | 2004-11-29 06:51:30 +0300 |
---|---|---|
committer | sergefp@mysql.com <> | 2004-11-29 06:51:30 +0300 |
commit | 0bf584d9a5b1fc44b6d5ef2d6debe19559b27f30 (patch) | |
tree | 0212745a88314b9199da4949005a684b4e2167f3 /mysql-test | |
parent | cb538e45f5f18c71c22daed3acd983ec9ff97176 (diff) | |
download | mariadb-git-0bf584d9a5b1fc44b6d5ef2d6debe19559b27f30.tar.gz |
Fix and testcase for BUG#6699
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/merge.result | 25 | ||||
-rw-r--r-- | mysql-test/t/merge.test | 18 |
2 files changed, 43 insertions, 0 deletions
diff --git a/mysql-test/r/merge.result b/mysql-test/r/merge.result index 5755033190b..f71626221cb 100644 --- a/mysql-test/r/merge.result +++ b/mysql-test/r/merge.result @@ -651,3 +651,28 @@ ERROR HY000: You can't specify target table 't1' for update in FROM clause create table t3 engine=merge union=(t1, t2) select * from t2; ERROR HY000: You can't specify target table 't2' for update in FROM clause drop table t1, t2; +create table t1 (a int,b int,c int, index (a,b,c)); +create table t2 (a int,b int,c int, index (a,b,c)); +create table t3 (a int,b int,c int, index (a,b,c)) +engine=merge union=(t1 ,t2); +insert into t1 (a,b,c) values (1,1,0),(1,2,0); +insert into t2 (a,b,c) values (1,1,1),(1,2,1); +explain select a,b,c from t3 force index (a) where a=1 order by a,b,c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref a a 5 const 2 Using where; Using index +select a,b,c from t3 force index (a) where a=1 order by a,b,c; +a b c +1 1 0 +1 1 1 +1 2 0 +1 2 1 +explain select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 ref a a 5 const 2 Using where; Using index +select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc; +a b c +1 2 1 +1 2 0 +1 1 1 +1 1 0 +drop table t1, t2, t3; diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index 9580c1ab44c..b628cb07f7b 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -285,3 +285,21 @@ create table t3 engine=merge union=(t1, t2) select * from t1; --error 1093 create table t3 engine=merge union=(t1, t2) select * from t2; drop table t1, t2; + +# BUG#6699 : no sorting on 'ref' retrieval +create table t1 (a int,b int,c int, index (a,b,c)); +create table t2 (a int,b int,c int, index (a,b,c)); +create table t3 (a int,b int,c int, index (a,b,c)) + engine=merge union=(t1 ,t2); +insert into t1 (a,b,c) values (1,1,0),(1,2,0); +insert into t2 (a,b,c) values (1,1,1),(1,2,1); + +explain select a,b,c from t3 force index (a) where a=1 order by a,b,c; +select a,b,c from t3 force index (a) where a=1 order by a,b,c; + +# this actually wasn't affected: +explain select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc; +select a,b,c from t3 force index (a) where a=1 order by a desc, b desc, c desc; + +drop table t1, t2, t3; + |