[Commits] d25af33116e: MDEV-18635 The test case for bug mdev-16727 crashes the server
revision-id: d25af33116edfc9ea91324e816ea783013127bba (mariadb-10.3.6-125-gd25af33116e) parent(s): e4f1094c5074e4931cca82fc45a82c1fe1ac8963 author: Galina Shalygina committer: Galina Shalygina timestamp: 2019-02-18 23:27:11 +0300 message: MDEV-18635 The test case for bug mdev-16727 crashes the server in the tree bb-10.4-mdev7486 The crash was caused because after merge of bb-10.4-mdev7486 and 10.4 branches changes for mdev-16727 were missing. --- mysql-test/main/in_subq_cond_pushdown.result | 13 ++++++++++++- mysql-test/main/in_subq_cond_pushdown.test | 20 ++++++++++---------- sql/opt_subselect.cc | 2 +- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/mysql-test/main/in_subq_cond_pushdown.result b/mysql-test/main/in_subq_cond_pushdown.result index 05feaa8c774..2dd66547e79 100644 --- a/mysql-test/main/in_subq_cond_pushdown.result +++ b/mysql-test/main/in_subq_cond_pushdown.result @@ -3836,13 +3836,24 @@ DROP TABLE t1; # of multiple equalities # CREATE TABLE t1 (a varchar(1)); -INSERT INTO `t1` VALUES ('x'), ('y'), ('z'); +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; # # MDEV-17360: IN subquery predicate with outer reference in the left part diff --git a/mysql-test/main/in_subq_cond_pushdown.test b/mysql-test/main/in_subq_cond_pushdown.test index eee32c05a4b..7763201cda1 100644 --- a/mysql-test/main/in_subq_cond_pushdown.test +++ b/mysql-test/main/in_subq_cond_pushdown.test @@ -799,7 +799,7 @@ DROP TABLE t1; --echo # CREATE TABLE t1 (a varchar(1)); -INSERT INTO `t1` VALUES ('x'), ('y'), ('z'); +INSERT INTO t1 VALUES ('x'), ('y'), ('z'); CREATE TABLE t2 (b varchar(1)); INSERT INTO t2 VALUES ('x'); @@ -810,15 +810,15 @@ 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 -# ); +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; diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index 2e339f03540..4f45d77a717 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -5803,7 +5803,7 @@ Item *and_new_conditions_to_optimized_cond(THD *thd, Item *cond, if (equality->fix_fields(thd, NULL)) return NULL; } - *cond_eq= &new_cond_equal; + (*cond_eq)->copy(new_cond_equal); } new_conds_list.append((List<Item> *)&new_cond_equal.current_level);
participants (1)
-
Galina