summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <bar@mysql.com>2006-01-12 16:07:06 +0400
committerunknown <bar@mysql.com>2006-01-12 16:07:06 +0400
commit35d46cee7c1114893cb9cccefa2113aee22ad8dd (patch)
treeb65bd84e37859f01f91674a234df633ef4d613d9 /mysql-test
parent46fdcba4f13ad54cb617dd3a649ee02f64bb8652 (diff)
parent29505f389bd7be4f83a588c26f39ae12895815d0 (diff)
downloadmariadb-git-35d46cee7c1114893cb9cccefa2113aee22ad8dd.tar.gz
Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/usr/home/bar/mysql-5.0
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/index_merge.result18
-rw-r--r--mysql-test/t/index_merge.test30
2 files changed, 48 insertions, 0 deletions
diff --git a/mysql-test/r/index_merge.result b/mysql-test/r/index_merge.result
index d039d5a04c9..db87253e19a 100644
--- a/mysql-test/r/index_merge.result
+++ b/mysql-test/r/index_merge.result
@@ -384,3 +384,21 @@ max(A.key1 + B.key1 + A.key2 + B.key2 + A.key3 + B.key3 + A.key4 + B.key4 + A.ke
8186
set join_buffer_size= @save_join_buffer_size;
drop table t0, t1, t2, t3, t4;
+CREATE TABLE t1 (
+cola char(3) not null, colb char(3) not null, filler char(200),
+key(cola), key(colb)
+);
+INSERT INTO t1 VALUES ('foo','bar', 'ZZ'),('fuz','baz', 'ZZ');
+OPTIMIZE TABLE t1;
+Table Op Msg_type Msg_text
+test.t1 optimize status OK
+select count(*) from t1;
+count(*)
+8704
+explain select * from t1 WHERE cola = 'foo' AND colb = 'bar';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index_merge cola,colb cola,colb 3,3 NULL 24 Using intersect(cola,colb); Using where
+explain select * from t1 force index(cola,colb) WHERE cola = 'foo' AND colb = 'bar';
+id select_type table type possible_keys key key_len ref rows Extra
+1 SIMPLE t1 index_merge cola,colb cola,colb 3,3 NULL 24 Using intersect(cola,colb); Using where
+drop table t1;
diff --git a/mysql-test/t/index_merge.test b/mysql-test/t/index_merge.test
index 42175a757c2..10512902409 100644
--- a/mysql-test/t/index_merge.test
+++ b/mysql-test/t/index_merge.test
@@ -327,3 +327,33 @@ set join_buffer_size= @save_join_buffer_size;
drop table t0, t1, t2, t3, t4;
+# BUG#16166
+CREATE TABLE t1 (
+ cola char(3) not null, colb char(3) not null, filler char(200),
+ key(cola), key(colb)
+);
+INSERT INTO t1 VALUES ('foo','bar', 'ZZ'),('fuz','baz', 'ZZ');
+
+--disable_query_log
+let $1=9;
+while ($1)
+{
+ eval INSERT INTO t1 SELECT * from t1 WHERE cola = 'foo';
+ dec $1;
+}
+
+let $1=13;
+while ($1)
+{
+ eval INSERT INTO t1 SELECT * from t1 WHERE cola <> 'foo';
+ dec $1;
+}
+
+--enable_query_log
+
+OPTIMIZE TABLE t1;
+select count(*) from t1;
+explain select * from t1 WHERE cola = 'foo' AND colb = 'bar';
+explain select * from t1 force index(cola,colb) WHERE cola = 'foo' AND colb = 'bar';
+drop table t1;
+