diff options
author | unknown <igor@rurik.mysql.com> | 2006-09-29 07:43:25 -0700 |
---|---|---|
committer | unknown <igor@rurik.mysql.com> | 2006-09-29 07:43:25 -0700 |
commit | af2ba777c3abeb5721fbc14e9d094ffa620c75a5 (patch) | |
tree | 96d1f2a44ecf76c4d86d94e0eb4e9cd925d087ca /mysql-test/r/select.result | |
parent | 78bf02870c9a277ae785ab5705b4a5c0556b149e (diff) | |
download | mariadb-git-af2ba777c3abeb5721fbc14e9d094ffa620c75a5.tar.gz |
Fixed bug #22753.
After the patch for big 21698 equality propagation stopped
working for BETWEEN and IN predicates with STRING arguments.
This changeset completes the solution of the above patch.
mysql-test/r/select.result:
Added a test case for bug #22735.
mysql-test/t/select.test:
Added a test case for bug #22735.
sql/item_cmpfunc.h:
Fixed bug #22753.
After the patch for big 21698 equality propagation stopped
working for BETWEEN and IN predicates with STRING arguments.
This changeset completes the solution of the above patch.
Added an implementation of the subst_argument_checker method
for Item_func_opt_neg (the direct ancestor of Item_func_between
and Item_func_in) which allows equality propagation for
BETWEEN and IN predicates.
Diffstat (limited to 'mysql-test/r/select.result')
-rw-r--r-- | mysql-test/r/select.result | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/mysql-test/r/select.result b/mysql-test/r/select.result index 0c62d3f570f..34b2a93e39b 100644 --- a/mysql-test/r/select.result +++ b/mysql-test/r/select.result @@ -3517,3 +3517,32 @@ id a b c d e 2 NULL NULL NULL 2 40 2 NULL NULL NULL 2 50 DROP TABLE t1,t2,t3; +CREATE TABLE t1 (pk varchar(10) PRIMARY KEY, fk varchar(16)); +CREATE TABLE t2 (pk varchar(16) PRIMARY KEY, fk varchar(10)); +INSERT INTO t1 VALUES +('d','dddd'), ('i','iii'), ('a','aa'), ('b','bb'), ('g','gg'), +('e','eee'), ('c','cccc'), ('h','hhh'), ('j','jjj'), ('f','fff'); +INSERT INTO t2 VALUES +('jjj', 'j'), ('cc','c'), ('ccc','c'), ('aaa', 'a'), ('jjjj','j'), +('hhh','h'), ('gg','g'), ('fff','f'), ('ee','e'), ('ffff','f'), +('bbb','b'), ('ff','f'), ('cccc','c'), ('dddd','d'), ('jj','j'), +('aaaa','a'), ('bb','b'), ('eeee','e'), ('aa','a'), ('hh','h'); +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk < 'c' AND t2.pk=t1.fk; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 12 NULL 3 Using where +1 SIMPLE t2 ref PRIMARY PRIMARY 18 test.t1.fk 1 Using where +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk BETWEEN 'a' AND 'b' AND t2.pk=t1.fk; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 12 NULL 2 Using where +1 SIMPLE t2 ref PRIMARY PRIMARY 18 test.t1.fk 1 Using where +EXPLAIN SELECT t2.* +FROM t1 JOIN t2 ON t2.fk=t1.pk +WHERE t2.fk IN ('a','b') AND t2.pk=t1.fk; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 12 NULL 2 Using where +1 SIMPLE t2 ref PRIMARY PRIMARY 18 test.t1.fk 1 Using where +DROP TABLE t1,t2; |