List:Commits« Previous MessageNext Message »
From:Martin Hansson Date:September 7 2010 8:04am
Subject:bzr push into mysql-5.5-merge branch (martin.hansson:3193 to 3194) Bug#54543
View as plain text  
 3194 Martin Hansson	2010-09-07 [merge]
      Merge of fix for Bug#54543. Test case only (bug is not present in this tree).

    modified:
      mysql-test/r/multi_update.result
      mysql-test/t/multi_update.test
 3193 Dmitry Shulga	2010-09-07 [merge]
      Auto-merge from mysql-5.1-bugteam.

    modified:
      include/mysql.h
      include/mysql.h.pp
      libmysql/libmysql.c
      tests/mysql_client_test.c
=== modified file 'mysql-test/r/multi_update.result'
--- a/mysql-test/r/multi_update.result	2010-05-26 14:34:25 +0000
+++ b/mysql-test/r/multi_update.result	2010-09-07 08:00:52 +0000
@@ -649,4 +649,24 @@ SET SESSION sql_safe_updates = 1;
 UPDATE IGNORE t1, t1 t1a SET t1.a = 1 WHERE t1a.a = 1;
 ERROR HY000: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
 DROP TABLE t1;
+#
+# Bug#54543: update ignore with incorrect subquery leads to assertion
+# failure: inited==INDEX
+#
+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);
+# Should not crash
+UPDATE IGNORE
+( SELECT ( SELECT COUNT(*) FROM t1 GROUP BY a, @v ) a FROM t2 ) x, t3
+SET t3.a = 0;
+Warnings:
+Error	1242	Subquery returns more than 1 row
+Error	1242	Subquery returns more than 1 row
+DROP TABLE t1, t2, t3;
+SET SESSION sql_safe_updates = DEFAULT;
 end of tests

=== modified file 'mysql-test/t/multi_update.test'
--- a/mysql-test/t/multi_update.test	2010-08-06 11:29:37 +0000
+++ b/mysql-test/t/multi_update.test	2010-09-07 08:00:52 +0000
@@ -650,5 +650,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


Attachment: [text/bzr-bundle] bzr/martin.hansson@oracle.com-20100907080052-4qdoj710nm0ejf1v.bundle
Thread
bzr push into mysql-5.5-merge branch (martin.hansson:3193 to 3194) Bug#54543Martin Hansson7 Sep