#At file:///data0/martin/bzr/bug50545/5.1bt-test_only/ based on revid:davi.arnaut@stripped
3384 Martin Hansson 2010-03-10
Bug#50545: Single table UPDATE IGNORE crashes on
join view in sql_safe_updates mode.
This bug was unexpectedly fixed along with bug
number 49534. This patch contains only the test
case.
modified:
mysql-test/r/update.result
mysql-test/t/update.test
=== modified file 'mysql-test/r/update.result'
--- a/mysql-test/r/update.result 2009-10-23 13:09:14 +0000
+++ b/mysql-test/r/update.result 2010-03-10 15:29:12 +0000
@@ -514,3 +514,16 @@ ALTER TABLE t2 COMMENT = 'ABC';
UPDATE t2, t1 SET t2.f1 = 2, t1.f1 = 9;
ALTER TABLE t2 COMMENT = 'DEF';
DROP TABLE t1, t2;
+#
+# Bug#50545: Single table UPDATE IGNORE crashes on join view in
+# sql_safe_updates mode.
+#
+CREATE TABLE t1 ( a INT, KEY( a ) );
+INSERT INTO t1 VALUES (0), (1);
+CREATE VIEW v1 AS SELECT t11.a, t12.a AS b FROM t1 t11, t1 t12;
+SET SESSION sql_safe_updates = 1;
+UPDATE IGNORE v1 SET 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
+SET SESSION sql_safe_updates = 0;
+DROP TABLE t1;
+DROP VIEW v1;
=== modified file 'mysql-test/t/update.test'
--- a/mysql-test/t/update.test 2009-10-23 13:09:14 +0000
+++ b/mysql-test/t/update.test 2010-03-10 15:29:12 +0000
@@ -467,3 +467,19 @@ UPDATE t2, t1 SET t2.f1 = 2, t1.f1 = 9;
ALTER TABLE t2 COMMENT = 'DEF';
DROP TABLE t1, t2;
+
+--echo #
+--echo # Bug#50545: Single table UPDATE IGNORE crashes on join view in
+--echo # sql_safe_updates mode.
+--echo #
+CREATE TABLE t1 ( a INT, KEY( a ) );
+INSERT INTO t1 VALUES (0), (1);
+CREATE VIEW v1 AS SELECT t11.a, t12.a AS b FROM t1 t11, t1 t12;
+SET SESSION sql_safe_updates = 1;
+
+--error ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE
+UPDATE IGNORE v1 SET a = 1;
+
+SET SESSION sql_safe_updates = 0;
+DROP TABLE t1;
+DROP VIEW v1;
Attachment: [text/bzr-bundle] bzr/martin.hansson@sun.com-20100310152912-11uuifcrmjoeoffi.bundle
| Thread |
|---|
| • bzr commit into mysql-5.1-bugteam branch (martin.hansson:3384) Bug#50545 | Martin Hansson | 10 Mar |