Commit 9c892564 authored by unknown's avatar unknown

Manual merge


sql/item_cmpfunc.h:
  Auto merged
parents 79ccef07 017f7897
......@@ -889,3 +889,25 @@ a b a b
2 2 2 2
NULL NULL 3 3
DROP TABLE t0,t1,t2,t3;
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;
a b a b
1 1 1 2
2 1 2 2
3 1 NULL NULL
4 2 NULL NULL
SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a WHERE t1.b=1;
a b a b
1 1 1 2
2 1 2 2
3 1 NULL NULL
SELECT * FROM t1 LEFT JOIN t2 ON t1.a=t2.a
WHERE t1.b=1 XOR (NOT ISNULL(t2.a) AND t2.b=1);
a b a b
1 1 1 2
2 1 2 2
3 1 NULL NULL
DROP TABLE t1,t2;
......@@ -588,12 +588,6 @@ INSERT INTO t2 VALUES("0", "SV", "0-SV");
INSERT INTO t2 VALUES("10", "EN", "10-EN");
INSERT INTO t2 VALUES("10", "SV", "10-SV");
SELECT t1.id, t1.text_id, t2.text_data
FROM t1 LEFT JOIN t2
ON t1.text_id = t2.text_id
AND t2.language_id = 'SV'
WHERE (t1.id LIKE '%' OR t2.text_data LIKE '%');
DROP TABLE t1, t2;
# Test for bug #5896
......@@ -630,3 +624,22 @@ select * from t2 right join t1 on t2.a=t1.a;
select straight_join * from t2 right join t1 on t2.a=t1.a;
DROP TABLE t0,t1,t2,t3;
#
# 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;
......@@ -1234,6 +1234,7 @@ class Item_cond_xor :public Item_cond
enum Type type() const { return FUNC_ITEM; }
longlong val_int();
const char *func_name() const { return "xor"; }
table_map not_null_tables() const { return and_tables_cache; }
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment