From 1230f3ad38e8e12d21726c78e37c841ec77322f2 Mon Sep 17 00:00:00 2001 From: "sergefp@mysql.com" <> Date: Tue, 15 Aug 2006 21:08:22 +0400 Subject: BUG#21282: Incorrect query results for "t.key NOT IN () 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/t/range.test | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'mysql-test/t/range.test') 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 -- cgit v1.2.1