summaryrefslogtreecommitdiff
path: root/mysql-test/t
diff options
context:
space:
mode:
authorGalina Shalygina <galina.shalygina@mariadb.com>2018-05-12 20:32:16 +0200
committerGalina Shalygina <galina.shalygina@mariadb.com>2018-05-12 20:32:16 +0200
commit6c0f3dd3414a97266912651fb169f630a36f2659 (patch)
tree5eefead4a36d975a55cf023e056e64657f13d4e3 /mysql-test/t
parent8b26fea83572cf5c043721b7835c3828937f9c27 (diff)
downloadmariadb-git-6c0f3dd3414a97266912651fb169f630a36f2659.tar.gz
MDEV-16090: Server crash in in Item_func_in::val_int or assertion `in_item'
failure upon SELECT with impossible condition The problem appears because of a wrong implementation of the Item_func_in::build_clone() method. It didn't clone 'array' and 'cmp_fields' fields for the cloned IN predicate and this could cause crashes. The Item_func_in::fix_length_and_dec() method was refactored and a new method named Item_func_in::create_array() was created. It allowed to create 'array' for cloned IN predicates in a proper way.
Diffstat (limited to 'mysql-test/t')
-rw-r--r--mysql-test/t/derived_cond_pushdown.test16
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/t/derived_cond_pushdown.test b/mysql-test/t/derived_cond_pushdown.test
index e8f6e9c11f9..d3832ce1ec3 100644
--- a/mysql-test/t/derived_cond_pushdown.test
+++ b/mysql-test/t/derived_cond_pushdown.test
@@ -1729,3 +1729,19 @@ EVAL EXPLAIN $query;
EVAL EXPLAIN FORMAT=JSON $query;
DROP TABLE t1,t2;
+
+--echo #
+--echo # MDEV-15765: pushing condition with IN subquery defined with constants
+--echo # using substitution
+--echo #
+
+CREATE TABLE t1 (a INT);
+INSERT INTO t1 VALUES (1),(2);
+SELECT * FROM
+(
+ SELECT DISTINCT * FROM t1
+) der_tab
+WHERE (a>0 AND a<2 OR a IN (2,3)) AND
+ (a=2 OR 0);
+
+DROP TABLE t1;