Below is the list of changes that have just been committed into a local
5.0 repository of kgeorge. When kgeorge does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2007-07-16 19:08:21+03:00, gkodinov@stripped +3 -0
Bug #29769: mistaken warning rolling back UPDATE with JOIN
and error in WHERE clause
The trans_safe flag was initialized inconsistently with
transactional_tables flag. Thus caused
multi_update::~multi_update to erroneously set the flag
that there are non-transactional table updated and as a
result the user is getting a wrong warning.
Fixed by setting the trans_safe flag to the correct
value (off)
mysql-test/r/multi_update.result@stripped, 2007-07-16 19:08:20+03:00, gkodinov@stripped +9 -0
Bug #29769: test case
mysql-test/t/multi_update.test@stripped, 2007-07-16 19:08:20+03:00, gkodinov@stripped +18 -0
Bug #29769: test case
sql/sql_update.cc@stripped, 2007-07-16 19:08:20+03:00, gkodinov@stripped +1 -1
Bug #29769: wrong initialization of the trans_safe flag
diff -Nrup a/mysql-test/r/multi_update.result b/mysql-test/r/multi_update.result
--- a/mysql-test/r/multi_update.result 2007-06-01 11:14:01 +03:00
+++ b/mysql-test/r/multi_update.result 2007-07-16 19:08:20 +03:00
@@ -557,4 +557,13 @@ show master status /* there must be the
File Position Binlog_Do_DB Binlog_Ignore_DB
master-bin.000001 204
drop table t1, t2;
+CREATE TABLE t1 (a INT, b INT);
+CREATE TABLE t2 (a INT, b INT);
+INSERT INTO t1 VALUES (1,1),(2,2);
+INSERT INTO t2 VALUES (1,1),(2,2);
+BEGIN;
+UPDATE t1 JOIN t2 USING (a) SET t1.b = 2 WHERE t1.c = 1;
+ERROR 42S22: Unknown column 't1.c' in 'where clause'
+ROLLBACK;
+DROP TABLE t1,t2;
end of tests
diff -Nrup a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test
--- a/mysql-test/t/multi_update.test 2007-06-01 11:14:01 +03:00
+++ b/mysql-test/t/multi_update.test 2007-07-16 19:08:20 +03:00
@@ -574,4 +574,22 @@ show master status /* there must be the
# cleanup bug#27716
drop table t1, t2;
+#
+# Bug #29769: mistaken warning rolling back UPDATE with JOIN and error in
+# WHERE clause
+#
+
+CREATE TABLE t1 (a INT, b INT);
+CREATE TABLE t2 (a INT, b INT);
+
+INSERT INTO t1 VALUES (1,1),(2,2);
+INSERT INTO t2 VALUES (1,1),(2,2);
+
+BEGIN;
+--error ER_BAD_FIELD_ERROR
+UPDATE t1 JOIN t2 USING (a) SET t1.b = 2 WHERE t1.c = 1;
+ROLLBACK;
+
+DROP TABLE t1,t2;
+
--echo end of tests
diff -Nrup a/sql/sql_update.cc b/sql/sql_update.cc
--- a/sql/sql_update.cc 2007-06-05 02:14:07 +03:00
+++ b/sql/sql_update.cc 2007-07-16 19:08:20 +03:00
@@ -992,7 +992,7 @@ multi_update::multi_update(TABLE_LIST *t
:all_tables(table_list), leaves(leaves_list), update_tables(0),
tmp_tables(0), updated(0), found(0), fields(field_list),
values(value_list), table_count(0), copy_field(0),
- handle_duplicates(handle_duplicates_arg), do_update(1), trans_safe(0),
+ handle_duplicates(handle_duplicates_arg), do_update(1), trans_safe(1),
transactional_tables(1), ignore(ignore_arg)
{}
| Thread |
|---|
| • bk commit into 5.0 tree (gkodinov:1.2530) BUG#29769 | kgeorge | 16 Jul |