summaryrefslogtreecommitdiff
path: root/mysql-test/t/join_outer.test
diff options
context:
space:
mode:
authorIgor Babaev <igor@askmonty.org>2013-05-03 22:46:45 -0700
committerIgor Babaev <igor@askmonty.org>2013-05-03 22:46:45 -0700
commit920c479c6ebd2236dbe5510e5ed8b748bf0ee158 (patch)
treeb5895605eba5f91e3cf0cce0b870076e6571f98c /mysql-test/t/join_outer.test
parentb249680fd11f5c9102f7a22cf638f3872d5c2e61 (diff)
downloadmariadb-git-920c479c6ebd2236dbe5510e5ed8b748bf0ee158.tar.gz
Fixed bug mdev-4336.
When iterating over a list of conditions using List_iterator the function remove_eq_conds should skip all predicates that replace a condition from the list. Otherwise it can come to an infinite recursion.
Diffstat (limited to 'mysql-test/t/join_outer.test')
-rw-r--r--mysql-test/t/join_outer.test17
1 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/t/join_outer.test b/mysql-test/t/join_outer.test
index 69c08cd54bd..8c0ee82e1fa 100644
--- a/mysql-test/t/join_outer.test
+++ b/mysql-test/t/join_outer.test
@@ -1359,4 +1359,21 @@ ORDER BY t1.b;
DROP TABLE t1,t2;
+--echo #
+--echo # Bug mdev-4336: LEFT JOIN with disjunctive
+--echo # <non-nullable datetime field> IS NULL in WHERE
+--echo # causes a hang and eventual crash
+--echo #
+
+CREATE TABLE t1 (
+ id int(11) NOT NULL,
+ modified datetime NOT NULL,
+ PRIMARY KEY (id)
+);
+
+SELECT a.* FROM t1 a LEFT JOIN t1 b ON a.id = b.id
+ WHERE a.modified > b.modified or b.modified IS NULL;
+
+DROP TABLE t1;
+
SET optimizer_switch=@save_optimizer_switch;