mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fixed bug mdev-4952
When in function remove_eq_conds() a sub-formula of the processed condition is replaced for another formula we should ensure that in the resulting formula AND/OR levels must alternate.
This commit is contained in:
@ -1392,4 +1392,22 @@ SELECT * FROM t1 LEFT JOIN t2 ON i1 = i2 WHERE d1 IS NULL AND d2 IS NULL;
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
--echo #
|
||||
--echo # Bug mdev-4952: LEFT JOIN with disjunctive
|
||||
--echo # <non-nullable datetime field> IS NULL in WHERE
|
||||
--echo # causes an assert failure
|
||||
--echo #
|
||||
|
||||
CREATE TABLE t1 (a1 int, b1 int NOT NULL) ENGINE=MyISAM;
|
||||
INSERT INTO t1 VALUES (1, 10), (2, 11);
|
||||
|
||||
CREATE TABLE t2 (dt datetime NOT NULL, a2 int, b2 int) ENGINE=MyISAM;
|
||||
INSERT INTO t2 VALUES
|
||||
('2006-10-08 09:34:54', 1, 100), ('2001-01-19 01:04:43', 2, 200);
|
||||
|
||||
SELECT * FROM t1 LEFT JOIN t2 ON a1 = a2
|
||||
WHERE ( dt IS NULL OR FALSE ) AND b2 IS NULL;
|
||||
|
||||
DROP TABLE t1,t2;
|
||||
|
||||
SET optimizer_switch=@save_optimizer_switch;
|
||||
|
Reference in New Issue
Block a user