summaryrefslogtreecommitdiff
path: root/mysql-test/t/bdb.test
diff options
context:
space:
mode:
authorunknown <jimw@mysql.com>2005-12-08 12:33:33 -0800
committerunknown <jimw@mysql.com>2005-12-08 12:33:33 -0800
commitab597139a7e96d8e3194739299b9dbde5a6cf961 (patch)
tree17c25f1452a24b4c5142a7cd6aa2a37e7558efcf /mysql-test/t/bdb.test
parent5aeb69296a4e134f0215da3e6bcce4956b7d76ad (diff)
downloadmariadb-git-ab597139a7e96d8e3194739299b9dbde5a6cf961.tar.gz
Fix calls to free_underlaid_joins() in INSERT, DELETE, and UPDATE
handling so that indexes are closed before trying to commit the transaction. (Bug #15536) mysql-test/r/bdb.result: Add new results mysql-test/t/bdb.test: Add new test sql/sql_delete.cc: Move call to free_underlaid_joins() to before ha_autocommit_or_rollback(). sql/sql_insert.cc: Move call to free_underlaid_joins() to before ha_autocommit_or_rollback(). sql/sql_update.cc: Move call to free_underlaid_joins() to before ha_autocommit_or_rollback().
Diffstat (limited to 'mysql-test/t/bdb.test')
-rw-r--r--mysql-test/t/bdb.test20
1 files changed, 19 insertions, 1 deletions
diff --git a/mysql-test/t/bdb.test b/mysql-test/t/bdb.test
index 6ceb0ea0789..de9709b97ad 100644
--- a/mysql-test/t/bdb.test
+++ b/mysql-test/t/bdb.test
@@ -930,4 +930,22 @@ SELECT id FROM t1 WHERE (list_id = 1) AND (term = "lettera");
SELECT id FROM t1 WHERE (list_id = 1) AND (term = "letterd");
DROP TABLE t1;
-# End of 4.1 tests
+#
+# Bug #15536: Crash when DELETE with subquery using BDB tables
+#
+create table t1 (a int, key(a)) engine=bdb;
+create table t2 (b int, key(b)) engine=bdb;
+insert into t1 values (1),(1),(2),(3),(4);
+insert into t2 values (1),(5),(6),(7);
+delete from t1 where (a in (select b from t2));
+select count(*) from t1;
+# INSERT also blows up
+--error 1242
+insert into t1 set a=(select b from t2);
+select count(*) from t1;
+# UPDATE also blows up
+update t1 set a = a + 1 where (a in (select b from t2));
+select count(*) from t1;
+drop table t1, t2;
+
+--echo End of 4.1 tests