List:Internals« Previous MessageNext Message »
From:sanja Date:October 13 2005 10:24pm
Subject:bk commit into 4.1 tree (bell:1.2479) BUG#13236
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of bell. When bell 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
  1.2479 05/10/13 23:24:54 bell@stripped +3 -0
  - set 'updating' in both tables list if we have two of them (because of subquery) (BUG#13236)
  - fixed test

  sql/sql_update.cc
    1.145 05/10/13 23:24:51 bell@stripped +6 -2
    set 'updating' in both tables list if we have two of them (because of subquery)

  mysql-test/t/rpl_multi_update2.test
    1.6 05/10/13 23:24:51 bell@stripped +29 -0
    fixed setting/reseting environment
    multi-update with subquery added

  mysql-test/r/rpl_multi_update2.result
    1.4 05/10/13 23:24:50 bell@stripped +18 -0
    fixed setting/reseting environment
    multi-update with subquery added

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	bell
# Host:	sanja.is.com.ua
# Root:	/home/bell/mysql/bk/work-qc-4.1

--- 1.144/sql/sql_update.cc	2005-10-10 16:09:44 +03:00
+++ 1.145/sql/sql_update.cc	2005-10-13 23:24:51 +03:00
@@ -569,7 +569,9 @@
         }
 	DBUG_PRINT("info",("setting table `%s` for update", tl->alias));
 	tl->lock_type= thd->lex->multi_lock_option;
-	tl->updating= 1;
+        tl->updating= 1;               // loacal or only list
+        if (tl->table_list)
+          tl->table_list->updating= 1; // global list (if we have 2 lists)
 	wants= UPDATE_ACL;
       }
       else
@@ -579,7 +581,9 @@
 	// correct order of statements. Otherwise, we use a TL_READ lock to
 	// improve performance.
 	tl->lock_type= using_update_log ? TL_READ_NO_INSERT : TL_READ;
-	tl->updating= 0;
+        tl->updating= 0;               // loacal or only list
+        if (tl->table_list)
+          tl->table_list->updating= 0; // global list (if we have 2 lists)
 	wants= SELECT_ACL;
       }
 

--- 1.3/mysql-test/r/rpl_multi_update2.result	2005-09-15 17:18:53 +03:00
+++ 1.4/mysql-test/r/rpl_multi_update2.result	2005-10-13 23:24:50 +03:00
@@ -4,6 +4,7 @@
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
+drop table if exists t1,t2;
 CREATE TABLE t1 (
 a int unsigned not null auto_increment primary key,
 b int unsigned
@@ -40,3 +41,20 @@
 a	b
 1	0
 2	1
+drop table t1,t2;
+reset master;
+CREATE TABLE t1 ( a INT );
+INSERT INTO t1 VALUES (0);
+UPDATE t1, (SELECT 3 as b) AS x SET t1.a = x.b;
+select * from t1;
+a
+3
+select * from t1;
+a
+3
+show binlog events limit 1,100;
+Log_name	Pos	Event_type	Server_id	Orig_log_pos	Info
+slave-bin.000001	#	Query	1	#	use `test`; CREATE TABLE t1 ( a INT )
+slave-bin.000001	#	Query	1	#	use `test`; INSERT INTO t1 VALUES (0)
+slave-bin.000001	#	Query	1	#	use `test`; UPDATE t1, (SELECT 3 as b) AS x SET t1.a = x.b
+drop table t1;

--- 1.5/mysql-test/t/rpl_multi_update2.test	2005-09-15 17:17:20 +03:00
+++ 1.6/mysql-test/t/rpl_multi_update2.test	2005-10-13 23:24:51 +03:00
@@ -4,6 +4,10 @@
 
 source include/master-slave.inc;
 
+--disable_warnings
+drop table if exists t1,t2;
+--enable_warnings
+
 CREATE TABLE t1 (
  a int unsigned not null auto_increment primary key,
  b int unsigned
@@ -31,5 +35,30 @@
 sync_with_master;
 SELECT * FROM t1 ORDER BY a;
 SELECT * FROM t2 ORDER BY a;
+
+connection master;
+drop table t1,t2;
+sync_slave_with_master;
+
+#
+# BUG#13236 multi-update with subquery & --replicate-ignore-table
+#
+reset master;
+
+connection master;
+CREATE TABLE t1 ( a INT );
+INSERT INTO t1 VALUES (0);
+UPDATE t1, (SELECT 3 as b) AS x SET t1.a = x.b;
+select * from t1;
+sync_slave_with_master;
+
+connection slave;
+select * from t1;
+--replace_column 2 # 5 #
+show binlog events limit 1,100;
+
+connection master;
+drop table t1;
+sync_slave_with_master;
 
 # End of 4.1 tests
Thread
bk commit into 4.1 tree (bell:1.2479) BUG#13236sanja13 Oct