summaryrefslogtreecommitdiff
path: root/mysql-test/t/range.test
diff options
context:
space:
mode:
authorunknown <sergefp@pylon.mylan>2006-07-14 19:10:54 +0400
committerunknown <sergefp@pylon.mylan>2006-07-14 19:10:54 +0400
commit906cd90d936e384af54c1f4e75ebb56bd2f6b148 (patch)
tree87954e7f7ef9f81fad617a3f0ce2dbdf770a5a89 /mysql-test/t/range.test
parent3657f34629eaa8ac37dc0dafad7a95dbe0b1180a (diff)
parent047e2be28c9a4a51c2c0348f970f78bed6c601af (diff)
downloadmariadb-git-906cd90d936e384af54c1f4e75ebb56bd2f6b148.tar.gz
Merge mysql.com:/home/psergey/tmp_merge-2
into mysql.com:/home/psergey/mysql-5.1-merge-2 mysql-test/r/range.result: Auto merged mysql-test/t/range.test: Auto merged sql/opt_range.cc: Auto merged
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 d1ce1104322..76929cf30e6 100644
--- a/mysql-test/t/range.test
+++ b/mysql-test/t/range.test
@@ -490,6 +490,31 @@ SELECT count(*) FROM t1 WHERE CLIENT='000' AND (ARG1 != ' 1' OR ARG1 != ' 2');
SELECT count(*) FROM t1 WHERE CLIENT='000' AND (ARG1 != ' 2' OR ARG1 != ' 1');
drop table t1;
+# BUG#16168: Wrong range optimizer results, "Use_count: Wrong count ..."
+# warnings in server stderr.
+create table t1 (a int);
+insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
+
+CREATE TABLE t2 (
+ pk1 int(11) NOT NULL,
+ pk2 int(11) NOT NULL,
+ pk3 int(11) NOT NULL,
+ pk4 int(11) NOT NULL,
+ filler char(82),
+ PRIMARY KEY (pk1,pk2,pk3,pk4)
+) DEFAULT CHARSET=latin1;
+
+insert into t2 select 1, A.a+10*B.a, 432, 44, 'fillerZ' from t1 A, t1 B;
+INSERT INTO t2 VALUES (2621, 2635, 0, 0,'filler'), (2621, 2635, 1, 0,'filler'),
+ (2621, 2635, 10, 0,'filler'), (2621, 2635, 11, 0,'filler'),
+ (2621, 2635, 14, 0,'filler'), (2621, 2635, 1000015, 0,'filler');
+
+SELECT * FROM t2
+WHERE ((((pk4 =0) AND (pk1 =2621) AND (pk2 =2635)))
+OR ((pk4 =1) AND (((pk1 IN ( 7, 2, 1 ))) OR (pk1 =522)) AND ((pk2 IN ( 0, 2635))))
+) AND (pk3 >=1000000);
+drop table t1, t2;
+
# End of 4.1 tests
#