summaryrefslogtreecommitdiff
path: root/mysql-test/t/range.test
diff options
context:
space:
mode:
authorunknown <sergefp@mysql.com>2006-08-15 21:08:22 +0400
committerunknown <sergefp@mysql.com>2006-08-15 21:08:22 +0400
commit9cf4750ec3cfa97ee839bb84cc25629c5512bab2 (patch)
treec79e63e45405045be41cc62433525fd9c65b17b0 /mysql-test/t/range.test
parent2f5ae7c536ae37a408f1e391ef21c743bd9b1b0e (diff)
downloadmariadb-git-9cf4750ec3cfa97ee839bb84cc25629c5512bab2.tar.gz
BUG#21282: Incorrect query results for "t.key NOT IN (<big const list>)
In fix for BUG#15872, a condition of type "t.key NOT IN (c1, .... cN)" where N>1000, was incorrectly converted to (-inf < X < c_min) OR (c_max < X) Now this conversion is removed, we dont produce any range lists for such conditions. mysql-test/r/range.result: BUG#21282: Testcase mysql-test/t/range.test: BUG#21282: Testcase sql/opt_range.cc: BUG#21282: Incorrect query results for "t.key NOT IN (<big const list>) In fix for BUG#15872, a condition of type "t.key NOT IN (c1, .... cN)" where N>1000, was incorrectly converted to (-inf < X < c_min) OR (c_max < X) Now this conversion is removed, we dont produce any range lists for such conditions.
Diffstat (limited to 'mysql-test/t/range.test')
-rw-r--r--mysql-test/t/range.test25
1 files changed, 25 insertions, 0 deletions
diff --git a/mysql-test/t/range.test b/mysql-test/t/range.test
index d53b05b98b1..57b5ab8f419 100644
--- a/mysql-test/t/range.test
+++ b/mysql-test/t/range.test
@@ -656,3 +656,28 @@ explain select * from t1 where a not between 'b' and 'b';
select a, hex(filler) from t1 where a not between 'b' and 'b';
drop table t1,t2,t3;
+
+#
+# BUG#21282
+#
+create table t1 (a int);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+create table t2 (a int, key(a));
+insert into t2 select 2*(A.a + 10*(B.a + 10*C.a)) from t1 A, t1 B, t1 C;
+
+set @a="select * from t2 force index (a) where a NOT IN(0";
+select count(*) from (select @a:=concat(@a, ',', a) from t2 ) Z;
+set @a=concat(@a, ')');
+
+insert into t2 values (11),(13),(15);
+
+set @b= concat("explain ", @a);
+
+prepare stmt1 from @b;
+execute stmt1;
+
+prepare stmt1 from @a;
+execute stmt1;
+
+drop table t1, t2;
+# End of 5.0 tests