diff options
author | unknown <sergefp@mysql.com> | 2005-03-11 02:17:03 +0300 |
---|---|---|
committer | unknown <sergefp@mysql.com> | 2005-03-11 02:17:03 +0300 |
commit | 7c90fa7b2cb8131bfcf314c1e25538bd1062fa5d (patch) | |
tree | 1a23fa03e38a10c027a627f427f5eddeb9044b97 /mysql-test | |
parent | 44d66d26dc6dbf1e7c90dc3c4cffe7b5d4baba41 (diff) | |
download | mariadb-git-7c90fa7b2cb8131bfcf314c1e25538bd1062fa5d.tar.gz |
Fix for BUG#8711: "<=>" may have true value for NULL arguments, so make
Item_func_equal::not_null_tables() always return 0.
mysql-test/r/join_outer.result:
Testcase for BUG#8711
mysql-test/t/join_outer.test:
Testcase for BUG#8711
sql/item_cmpfunc.h:
Fix for BUG#8711: "<=>" may have true value for NULL arguments, i.e. it can accept NULL-complemented
table rows. This differs from assumptions made in Item_func::not_null_tables(), so add
Item_func_equal::not_null_tables().
Item_func_equal::not_null_tables_cache value doesn't make sense now, but we still let it be
calculated (and ignore it)
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/join_outer.result | 20 | ||||
-rw-r--r-- | mysql-test/t/join_outer.test | 13 |
2 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/r/join_outer.result b/mysql-test/r/join_outer.result index 5778b2f9b72..d6ce93e632b 100644 --- a/mysql-test/r/join_outer.result +++ b/mysql-test/r/join_outer.result @@ -684,3 +684,23 @@ t1 ALL NULL NULL NULL NULL 3 t2 ALL NULL NULL NULL NULL 2 t3 ALL NULL NULL NULL NULL 2 drop table t1, t2, t3; +create table t1 ( +a int(11), +b char(10), +key (a) +); +insert into t1 (a) values (1),(2),(3),(4); +create table t2 (a int); +select * from t1 left join t2 on t1.a=t2.a where not (t2.a <=> t1.a); +a b a +1 NULL NULL +2 NULL NULL +3 NULL NULL +4 NULL NULL +select * from t1 left join t2 on t1.a=t2.a having not (t2.a <=> t1.a); +a b a +1 NULL NULL +2 NULL NULL +3 NULL NULL +4 NULL NULL +drop table t1,t2; diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test index bed4d4b033b..f32cc9d56ac 100644 --- a/mysql-test/t/join_outer.test +++ b/mysql-test/t/join_outer.test @@ -450,3 +450,16 @@ select * from t1 left join t2 on b1 = a1 left join t3 on c1 = a1 and b1 is explain select * from t1 left join t2 on b1 = a1 left join t3 on c1 = a1 and b1 is null; drop table t1, t2, t3; + +# Test for BUG#8711 '<=>' was considered to be a NULL-rejecting predicate. +create table t1 ( + a int(11), + b char(10), + key (a) +); +insert into t1 (a) values (1),(2),(3),(4); +create table t2 (a int); + +select * from t1 left join t2 on t1.a=t2.a where not (t2.a <=> t1.a); +select * from t1 left join t2 on t1.a=t2.a having not (t2.a <=> t1.a); +drop table t1,t2; |