diff options
author | Alexander Barkov <bar@mariadb.org> | 2016-06-28 13:11:04 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2016-06-28 13:11:04 +0400 |
commit | 56a34960678874fad2ec99cc94c37f4e82dfccaa (patch) | |
tree | dc4989b3e276d90ba3dda98735a2b841bf9183d3 /mysql-test/r/null.result | |
parent | 64c115b835e4108c089fee7f0bb2f8e4022eae7b (diff) | |
download | mariadb-git-56a34960678874fad2ec99cc94c37f4e82dfccaa.tar.gz |
MDEV-10236 Where expression with NOT function gives incorrect result
Item_cache::is_null() erroneously returned null_value in a
non-cached state. Now Item_cache::is_null() uses has_value(),
which caches the value if not cached yet, similar to what other value methods do
(e.g. val_int, val_real, etc).
Diffstat (limited to 'mysql-test/r/null.result')
-rw-r--r-- | mysql-test/r/null.result | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/r/null.result b/mysql-test/r/null.result index 0d012e283b5..fcaaeb2192f 100644 --- a/mysql-test/r/null.result +++ b/mysql-test/r/null.result @@ -1572,5 +1572,22 @@ SELECT * FROM t1 WHERE NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(NULLIF(N i DROP TABLE t1; # +# MDEV-10236 Where expression with NOT function gives incorrect result +# +CREATE TABLE t1 (c1 INT); +INSERT INTO t1 VALUES (1),(2),(3); +EXPLAIN EXTENDED +SELECT * FROM t1 WHERE ((c1 IS NOT NULL) >= (NOT TRUE)) IS NOT NULL; +id select_type table type possible_keys key key_len ref rows filtered Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00 Using where +Warnings: +Note 1003 select `test`.`t1`.`c1` AS `c1` from `test`.`t1` where (((`test`.`t1`.`c1` is not null) >= <cache>((not(1)))) is not null) +SELECT * FROM t1 WHERE ((c1 IS NOT NULL) >= (NOT TRUE)) IS NOT NULL; +c1 +1 +2 +3 +DROP TABLE t1; +# # End of 10.1 tests # |