summaryrefslogtreecommitdiff
path: root/mysql-test/t/multi_update.test
diff options
context:
space:
mode:
authorMartin Hansson <martin.hansson@oracle.com>2010-09-07 09:58:05 +0200
committerMartin Hansson <martin.hansson@oracle.com>2010-09-07 09:58:05 +0200
commit446cc653c0ab13a6fec8ab54de9f5596389b08bc (patch)
treeb5a71beeffb63735a0ec8e19060817e72a1751b5 /mysql-test/t/multi_update.test
parentd2d4fdb23f6b38ff6718a35120043627582ee836 (diff)
downloadmariadb-git-446cc653c0ab13a6fec8ab54de9f5596389b08bc.tar.gz
Bug#54543: update ignore with incorrect subquery leads to assertion failure:
inited==INDEX When an error occurs while sending the data in a temporary table there was no cleanup performed. This caused a failed assertion in the case when different access methods were used for populating the table vs. retrieving the data from the table if IGNORE was specified and sql_safe_updates = 0. In this case execution continues, but the handler expects to continue with the access method used for row retrieval. Fixed by doing the cleanup even if errors occur.
Diffstat (limited to 'mysql-test/t/multi_update.test')
-rw-r--r--mysql-test/t/multi_update.test21
1 files changed, 21 insertions, 0 deletions
diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test
index 559408eb90e..85d2ed19fda 100644
--- a/mysql-test/t/multi_update.test
+++ b/mysql-test/t/multi_update.test
@@ -651,5 +651,26 @@ SET SESSION sql_safe_updates = 1;
UPDATE IGNORE t1, t1 t1a SET t1.a = 1 WHERE t1a.a = 1;
DROP TABLE t1;
+--echo #
+--echo # Bug#54543: update ignore with incorrect subquery leads to assertion
+--echo # failure: inited==INDEX
+--echo #
+SET SESSION sql_safe_updates = 0;
+CREATE TABLE t1 ( a INT );
+INSERT INTO t1 VALUES (1), (2);
+
+CREATE TABLE t2 ( a INT );
+INSERT INTO t2 VALUES (1), (2);
+
+CREATE TABLE t3 ( a INT );
+INSERT INTO t3 VALUES (1), (2);
+
+--echo # Should not crash
+UPDATE IGNORE
+ ( SELECT ( SELECT COUNT(*) FROM t1 GROUP BY a, @v ) a FROM t2 ) x, t3
+SET t3.a = 0;
+
+DROP TABLE t1, t2, t3;
+SET SESSION sql_safe_updates = DEFAULT;
--echo end of tests