MySQL Lists are EOL. Please join:

List:Commits« Previous MessageNext Message »
From:Martin Hansson Date:March 10 2010 4:12pm
Subject:bzr commit into mysql-pe branch (martin.hansson:3962) Bug#50545
View as plain text  
#At file:///data0/martin/bzr/bug50545/6.0bt-test_only/ based on revid:svoj@stripped

 3962 Martin Hansson	2010-03-10 [merge]
      Merge of Bug#50545 (test case only)

    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 16:10:05 +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 = DEFAULT;
+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 16:10:05 +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 = DEFAULT;
+DROP TABLE t1;
+DROP VIEW v1;


Attachment: [text/bzr-bundle] bzr/martin.hansson@sun.com-20100310161227-zr6wwqiqf0hmsy4j.bundle
Thread
bzr commit into mysql-pe branch (martin.hansson:3962) Bug#50545Martin Hansson10 Mar