[Commits] Rev 2873: Testcase Backport: BUG#48093: 6.0 Server not processing equivalent IN clauses properly in file:///home/psergey/dev2/5.3-fix-subq/

Sergey Petrunya psergey at askmonty.org
Thu Jan 13 23:15:45 EET 2011


At file:///home/psergey/dev2/5.3-fix-subq/

------------------------------------------------------------
revno: 2873
revision-id: psergey at askmonty.org-20110113211544-s0iav9plb5mxi9u2
parent: psergey at askmonty.org-20110113204715-8wcq011d15t0d0hf
committer: Sergey Petrunya <psergey at askmonty.org>
branch nick: 5.3-fix-subq
timestamp: Fri 2011-01-14 00:15:44 +0300
message:
  Testcase Backport: BUG#48093: 6.0 Server not processing equivalent IN clauses properly
=== modified file 'mysql-test/r/index_merge_innodb.result'
--- a/mysql-test/r/index_merge_innodb.result	2010-12-06 09:25:04 +0000
+++ b/mysql-test/r/index_merge_innodb.result	2011-01-13 21:15:44 +0000
@@ -709,3 +709,34 @@
 COUNT(*)
 6145
 DROP TABLE t1;
+#
+# Testcase Backport: BUG#48093: 6.0 Server not processing equivalent IN clauses properly
+#            with Innodb tables
+#
+CREATE TABLE t1 (
+i int(11) DEFAULT NULL,
+v1 varchar(1) DEFAULT NULL,
+v2 varchar(20) DEFAULT NULL,
+KEY i (i),
+KEY v (v1,i)
+) ENGINE=innodb;
+INSERT INTO t1 VALUES (1,'f','no');
+INSERT INTO t1 VALUES (2,'u','yes-u');
+INSERT INTO t1 VALUES (2,'h','yes-h');
+INSERT INTO t1 VALUES (3,'d','no');
+
+SELECT v2
+FROM t1
+WHERE v1  IN  ('f', 'd', 'h', 'u' ) AND i  =  2;
+v2
+yes-u
+yes-h
+
+# Should not use index_merge
+EXPLAIN
+SELECT v2
+FROM t1
+WHERE v1  IN  ('f', 'd', 'h', 'u' ) AND i  =  2;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	ref	i,v	i	5	const	2	Using where
+DROP TABLE t1;

=== modified file 'mysql-test/t/index_merge_innodb.test'
--- a/mysql-test/t/index_merge_innodb.test	2010-12-06 09:25:04 +0000
+++ b/mysql-test/t/index_merge_innodb.test	2011-01-13 21:15:44 +0000
@@ -84,3 +84,37 @@
      WHERE a BETWEEN 2 AND 7 OR pk=1000000) AS t;
 
 DROP TABLE t1;
+
+--echo #
+--echo # Testcase Backport: BUG#48093: 6.0 Server not processing equivalent IN clauses properly
+--echo #            with Innodb tables
+--echo #
+
+CREATE TABLE t1 (
+  i int(11) DEFAULT NULL,
+  v1 varchar(1) DEFAULT NULL,
+  v2 varchar(20) DEFAULT NULL,
+  KEY i (i),
+  KEY v (v1,i)
+) ENGINE=innodb;
+
+INSERT INTO t1 VALUES (1,'f','no');
+INSERT INTO t1 VALUES (2,'u','yes-u');
+INSERT INTO t1 VALUES (2,'h','yes-h');
+INSERT INTO t1 VALUES (3,'d','no');
+
+--echo
+SELECT v2
+FROM t1
+WHERE v1  IN  ('f', 'd', 'h', 'u' ) AND i  =  2;
+
+--echo
+--echo # Should not use index_merge
+EXPLAIN
+SELECT v2
+FROM t1
+WHERE v1  IN  ('f', 'd', 'h', 'u' ) AND i  =  2;
+
+DROP TABLE t1;
+
+



More information about the commits mailing list