summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorGalina Shalygina <galina.shalygina@mariadb.com>2018-08-01 14:42:47 +0300
committerGalina Shalygina <galina.shalygina@mariadb.com>2018-08-01 14:42:47 +0300
commitaf46c25760bdc698cf219258f6c42316ed01b924 (patch)
treed37ebea2deac07acbc24619a0c46f72698b1fdd2 /mysql-test
parentb1ae4e7e154b9b1ffb87918a8646173e1f8063fe (diff)
downloadmariadb-git-af46c25760bdc698cf219258f6c42316ed01b924.tar.gz
MDEV-16727: Server crashes in Item_equal_iterator<List_iterator_fast, Item>::get_curr_field()
The bug appeares because of the lamely saved list of multiple equalities. To fix it and_new_conditions_to_optimized_cond() was changed.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/main/in_subq_cond_pushdown.result24
-rw-r--r--mysql-test/main/in_subq_cond_pushdown.test29
2 files changed, 53 insertions, 0 deletions
diff --git a/mysql-test/main/in_subq_cond_pushdown.result b/mysql-test/main/in_subq_cond_pushdown.result
index 4ad4180ff52..c9319a5fb86 100644
--- a/mysql-test/main/in_subq_cond_pushdown.result
+++ b/mysql-test/main/in_subq_cond_pushdown.result
@@ -3831,3 +3831,27 @@ WHERE (t1.a!=1)
a
2
DROP TABLE t1;
+#
+# MDEV-16727: failure assertion caused by the lamely saved list
+# of multiple equalities
+#
+CREATE TABLE t1 (a varchar(1));
+INSERT INTO `t1` VALUES ('x'), ('y'), ('z');
+CREATE TABLE t2 (b varchar(1));
+INSERT INTO t2 VALUES ('x');
+CREATE TABLE t3 (c varchar(1));
+INSERT INTO t3 VALUES ('y');
+CREATE TABLE t4 (d varchar(1));
+INSERT INTO t4 VALUES ('x'), ('z');
+SELECT * FROM t1
+JOIN t2 ON (t1.a=t2.b)
+LEFT JOIN t3 ON (t1.a=t3.c)
+WHERE (t1.a) IN
+(
+SELECT t4.d
+FROM t4
+ORDER BY t4.d
+);
+a b c
+x x NULL
+DROP TABLE t1,t2,t3,t4;
diff --git a/mysql-test/main/in_subq_cond_pushdown.test b/mysql-test/main/in_subq_cond_pushdown.test
index 8f911ea2f19..3c673fb128b 100644
--- a/mysql-test/main/in_subq_cond_pushdown.test
+++ b/mysql-test/main/in_subq_cond_pushdown.test
@@ -792,3 +792,32 @@ WHERE tbl.a IN
);
DROP TABLE t1;
+
+--echo #
+--echo # MDEV-16727: failure assertion caused by the lamely saved list
+--echo # of multiple equalities
+--echo #
+
+CREATE TABLE t1 (a varchar(1));
+INSERT INTO `t1` VALUES ('x'), ('y'), ('z');
+
+CREATE TABLE t2 (b varchar(1));
+INSERT INTO t2 VALUES ('x');
+
+CREATE TABLE t3 (c varchar(1));
+INSERT INTO t3 VALUES ('y');
+
+CREATE TABLE t4 (d varchar(1));
+INSERT INTO t4 VALUES ('x'), ('z');
+
+SELECT * FROM t1
+JOIN t2 ON (t1.a=t2.b)
+LEFT JOIN t3 ON (t1.a=t3.c)
+WHERE (t1.a) IN
+(
+ SELECT t4.d
+ FROM t4
+ ORDER BY t4.d
+);
+
+DROP TABLE t1,t2,t3,t4;