summaryrefslogtreecommitdiff
path: root/mysql-test/t/update_innodb.test
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2018-01-23 21:38:29 +0100
committerOleksandr Byelkin <sanja@mariadb.com>2018-01-23 21:38:29 +0100
commit6f78e6f98e470c874f691e130a5d74968af06063 (patch)
tree198ae9d86eea5f56349dc6f495f424cc39bae742 /mysql-test/t/update_innodb.test
parenta4663af05c1d1bd3abb537205df070ed2158e702 (diff)
downloadmariadb-git-bb-10.0-MDEV-14862.tar.gz
MDEV-14862: Server crashes in Bitmap<64u>::merge / add_key_fieldbb-10.0-MDEV-14862
It is backport of MySQL fix: Bug #19434916: FATAL_SIGNAL IN ADD_KEY_EQUAL_FIELDS() WITH UPDATE VIEW USING OUTER SUBQUERY Issue: ----- While resolving a column which refers to a table/view in an outer query, it's respecitve item object is marked with the outer query's select_lex object. But when the column refers to a view or if the column is part of a subquery in the HAVING clause, an Item_ref object is created. While the reference to the outer query is stored by the Item_ref object, the same is not stored in it's real_item. This creates a problem with the IN-TO-EXISTS optmization. When there is an index over the column in the inner query, it will be considered since the column's real_item object will be mistaken for a local field. This will lead to a crash. SOLUTION: --------- Under the current design, the only way to fix this issue is to check the reginfo.join_tab for a NULL value. If yes, the query should not be worrying about the key use. The testcase and comments added as part of the fix for Bug#17766653 have been backported.
Diffstat (limited to 'mysql-test/t/update_innodb.test')
-rw-r--r--mysql-test/t/update_innodb.test12
1 files changed, 12 insertions, 0 deletions
diff --git a/mysql-test/t/update_innodb.test b/mysql-test/t/update_innodb.test
index 67c356c4e2e..4ea321a60d2 100644
--- a/mysql-test/t/update_innodb.test
+++ b/mysql-test/t/update_innodb.test
@@ -37,3 +37,15 @@ UPDATE t1 a JOIN t2 b ON a.c1 = b.c1 JOIN v1 vw ON b.c2 = vw.c1 JOIN t3 del ON v
drop view v1;
drop table t1,t2,t3,t4;
+
+--echo #
+--echo # MDEV-14862: Server crashes in Bitmap<64u>::merge / add_key_field
+--echo #
+
+CREATE TABLE t1 (a INT) ENGINE=InnoDB;
+CREATE VIEW v1 AS SELECT * FROM t1;
+CREATE TABLE t2 (b INT) ENGINE=InnoDB;
+DELETE FROM v1 WHERE a IN ( SELECT a FROM t2 );
+
+drop view v1;
+drop table t1,t2;