diff options
author | Alexander Barkov <bar@mariadb.org> | 2015-08-28 17:03:09 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2015-08-28 17:03:09 +0400 |
commit | 3ba2a958beaf8ce5b4db23739b310ebad606d993 (patch) | |
tree | 05e015a000e10fc9b755cbe37238dd01be2b5742 /mysql-test/r/ctype_latin1.result | |
parent | 3bca8db4f90cd9a505b99009c44594c0fb1ec353 (diff) | |
download | mariadb-git-3ba2a958beaf8ce5b4db23739b310ebad606d993.tar.gz |
MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a'
Note, the patch for MDEV-8661 unintentionally fixed MDEV-8694 as well,
as a side effect. Adding a real clear fix: implementing
Item_func_like::propagate_equal_fields() with comments.
Diffstat (limited to 'mysql-test/r/ctype_latin1.result')
-rw-r--r-- | mysql-test/r/ctype_latin1.result | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/mysql-test/r/ctype_latin1.result b/mysql-test/r/ctype_latin1.result index df492800147..4c5b00593cd 100644 --- a/mysql-test/r/ctype_latin1.result +++ b/mysql-test/r/ctype_latin1.result @@ -7755,6 +7755,31 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) DROP TABLE t1; +# +# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a' +# +CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('a'),('a '); +SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a '; +a LENGTH(a) +a 1 +SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; +a LENGTH(a) +a 1 +EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (not((`test`.`t1`.`a` like 'a ')))) +DROP TABLE t1; +# +# End of MDEV-8694 +# SET NAMES latin1 COLLATE latin1_bin; # # MDEV-7149 Constant condition propagation erroneously applied for LIKE @@ -7852,6 +7877,31 @@ Warnings: Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (('%' = concat(`test`.`t1`.`c1`)) and ('a' like concat(`test`.`t1`.`c1`))) DROP TABLE t1; # +# MDEV-8694 Wrong result for SELECT..WHERE a NOT LIKE 'a ' AND a='a' +# +CREATE TABLE t1 AS SELECT SPACE(10) AS a LIMIT 0; +SHOW CREATE TABLE t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(10) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +INSERT INTO t1 VALUES ('a'),('a '); +SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a '; +a LENGTH(a) +a 1 +SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; +a LENGTH(a) +a 1 +EXPLAIN EXTENDED SELECT a, LENGTH(a) FROM t1 WHERE a NOT LIKE 'a ' AND a='a'; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`a` AS `a`,length(`test`.`t1`.`a`) AS `LENGTH(a)` from `test`.`t1` where ((`test`.`t1`.`a` = 'a') and (not((`test`.`t1`.`a` like 'a ')))) +DROP TABLE t1; +# +# End of MDEV-8694 +# +# # MDEV-6752 Trailing incomplete characters are not replaced to question marks on conversion # SET NAMES utf8, character_set_connection=latin1; |