summaryrefslogtreecommitdiff
path: root/mysql-test/r/derived.result
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2015-08-31 18:40:24 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2015-08-31 18:40:24 +0200
commit4b41e3c7f33714186c97a6cc2e6d3bb93b050c61 (patch)
treefdc312b7d2f3ed8f12af293f8f724c5148d91227 /mysql-test/r/derived.result
parentb66455f67da9b0bbe7fb7862c23a8283d766e149 (diff)
downloadmariadb-git-4b41e3c7f33714186c97a6cc2e6d3bb93b050c61.tar.gz
MDEV-6219: Server crashes in Bitmap<64u>::merge (this=0x180, map2=...) on 2nd execution of PS with INSERT .. SELECT, derived_merge
Problem: Not all permanent Item_direct_view_ref was in permanent list of used items of the view. Solution: Detect creating permenent view/derived table reference and put them in the permanent list at once.
Diffstat (limited to 'mysql-test/r/derived.result')
-rw-r--r--mysql-test/r/derived.result27
1 files changed, 26 insertions, 1 deletions
diff --git a/mysql-test/r/derived.result b/mysql-test/r/derived.result
index 7c44466ae92..2b0b1041936 100644
--- a/mysql-test/r/derived.result
+++ b/mysql-test/r/derived.result
@@ -567,7 +567,31 @@ insert into t1 (accountId,balance) values
update t1 set balance=(select sum(balance) from (SELECT balance FROM t1 where accountId like 'dealer%') AS copied) where accountId = 'OPERATOR';
set optimizer_switch=@save_derived_optimizer_switch_bug;
drop table t1;
-set optimizer_switch=@save_derived_optimizer_switch;
+#
+# MDEV-6219:Server crashes in Bitmap<64u>::merge
+# (this=0x180, map2=...) on 2nd execution of PS with INSERT .. SELECT,
+# derived_merge
+#
+CREATE TABLE t1 (a VARCHAR(8)) ENGINE=MyISAM;
+INSERT INTO t1 VALUES ('foo'),('bar');
+create procedure p1()
+INSERT INTO t1 SELECT * FROM (
+SELECT * FROM t1
+) AS sq
+WHERE sq.a IN ( SELECT 'baz' FROM DUAL );
+call p1();
+call p1();
+drop procedure p1;
+PREPARE stmt FROM "
+ INSERT INTO t1 SELECT * FROM (
+ SELECT * FROM t1
+ ) AS sq
+ WHERE sq.a IN ( SELECT 'baz' FROM DUAL )
+";
+EXECUTE stmt;
+EXECUTE stmt;
+deallocate prepare stmt;
+drop table t1;
#
# MDEV-6892: WHERE does not apply
#
@@ -580,3 +604,4 @@ select x.id, message from (select id from t1) x left join
where coalesce(message,0) <> 0;
id message
drop table t1,t2;
+set optimizer_switch=@save_derived_optimizer_switch;