diff options
author | unknown <igor@rurik.mysql.com> | 2005-03-12 23:31:52 -0800 |
---|---|---|
committer | unknown <igor@rurik.mysql.com> | 2005-03-12 23:31:52 -0800 |
commit | 7cecea527d5fcfa7c12c55ee3c95347ee8f43b15 (patch) | |
tree | 9d56e4798e76add9c769697efe2c6b5b95180ba4 /mysql-test/t/join_outer.test | |
parent | 81647853a13a016a5cfffdfe9d171733f52fa16d (diff) | |
download | mariadb-git-7cecea527d5fcfa7c12c55ee3c95347ee8f43b15.tar.gz |
join_outer.result, join_outer.test:
Added a test case for bug #9017.
item_cmpfunc.h:
A wrong not_null_tables method for Item_cond_xor
caused a conversion of a left join into an inner join
that was not valid.
sql/item_cmpfunc.h:
A wrong not_null_tables method for Item_cond_xor
caused a conversion of a left join into an inner join
that was not valid.
mysql-test/t/join_outer.test:
Added a test case for bug #9017.
mysql-test/r/join_outer.result:
Added a test case for bug #9017.
Diffstat (limited to 'mysql-test/t/join_outer.test')
-rw-r--r-- | mysql-test/t/join_outer.test | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test index 8096176a744..2ed7086746f 100644 --- a/mysql-test/t/join_outer.test +++ b/mysql-test/t/join_outer.test @@ -595,3 +595,22 @@ SELECT invoice.id, invoice.text_id, text_table.text_data WHERE (invoice.id LIKE '%' OR text_table.text_data LIKE '%'); DROP TABLE invoice, text_table; + +# +# Test for bug #9017: left join mistakingly converted to inner join +# + +CREATE TABLE t1 (a int PRIMARY KEY, b int); +CREATE TABLE t2 (a int PRIMARY KEY, b int); + +INSERT INTO t1 VALUES (1,1), (2,1), (3,1), (4,2); +INSERT INTO t2 VALUES (1,2), (2,2); + +SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a; +SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a WHERE t1.b=1; +SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a + WHERE t1.b=1 XOR (NOT ISNULL(t2.a) AND t2.b=1); + +DROP TABLE t1,t2; + + |