summaryrefslogtreecommitdiff
path: root/mysql-test/r
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/r
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/r')
-rw-r--r--mysql-test/r/derived_cond_pushdown.result15
1 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/r/derived_cond_pushdown.result b/mysql-test/r/derived_cond_pushdown.result
index 09b3b52b701..3fbc81019cc 100644
--- a/mysql-test/r/derived_cond_pushdown.result
+++ b/mysql-test/r/derived_cond_pushdown.result
@@ -9458,3 +9458,18 @@ EXPLAIN
}
}
DROP TABLE t1,t2;
+#
+# MDEV-15765: pushing condition with IN subquery defined with constants
+# using substitution
+#
+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);
+a
+2
+DROP TABLE t1;