List:Commits« Previous MessageNext Message »
From:Andrei Elkin Date:January 14 2006 8:06pm
Subject:bk commit into 5.0 tree (aelkin:1.2018) BUG#15699
View as plain text  
Below is the list of changes that have just been committed into a local
5.0 repository of elkin. When elkin 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.2018 06/01/14 22:06:51 aelkin@stripped +5 -0
  BUG#15699 multi-update could not execute repl do/ingore rules to leave earlier e.g
  because of non-existing table. This is fixed to always apply the rules.
  New test case basing on bug report is supplied.

  BitKeeper/etc/ignore
    1.214 06/01/14 22:06:46 aelkin@stripped +2 -0
    Added sql/sql_parse.cc.orig sql/sql_parse.cc.sav to the ignore list

  mysql-test/t/rpl_multi_update4.test
    1.1 06/01/14 21:53:50 aelkin@stripped +39 -0
    New BitKeeper file ``mysql-test/t/rpl_multi_update4.test''

  mysql-test/t/rpl_multi_update4-slave.opt
    1.1 06/01/14 21:53:50 aelkin@stripped +2 -0
    New BitKeeper file ``mysql-test/t/rpl_multi_update4-slave.opt''

  mysql-test/t/rpl_multi_update4.test
    1.0 06/01/14 21:53:50 aelkin@stripped +0 -0
    BitKeeper file /usr_rh9/home/elkin.rh9/MySQL/mysql-5.0-bug15699/mysql-test/t/rpl_multi_update4.test

  mysql-test/t/rpl_multi_update4-slave.opt
    1.0 06/01/14 21:53:50 aelkin@stripped +0 -0
    BitKeeper file /usr_rh9/home/elkin.rh9/MySQL/mysql-5.0-bug15699/mysql-test/t/rpl_multi_update4-slave.opt

  mysql-test/r/rpl_multi_update4.result
    1.1 06/01/14 21:53:49 aelkin@stripped +22 -0
    New BitKeeper file ``mysql-test/r/rpl_multi_update4.result''

  sql/sql_parse.cc
    1.524 06/01/14 21:53:49 aelkin@stripped +37 -27
    Postpone to leave with an error due to non-existing table until check of 
    do/ignore replication  rules. Should the latter exclude the query the previous 
    error state is creared.

  mysql-test/r/rpl_multi_update4.result
    1.0 06/01/14 21:53:49 aelkin@stripped +0 -0
    BitKeeper file /usr_rh9/home/elkin.rh9/MySQL/mysql-5.0-bug15699/mysql-test/r/rpl_multi_update4.result

# 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:	aelkin
# Host:	dsl-hkigw8-fe02f800-41.dhcp.inet.fi
# Root:	/usr_rh9/home/elkin.rh9/MySQL/mysql-5.0-bug15699

--- 1.523/sql/sql_parse.cc	2006-01-11 01:10:54 +02:00
+++ 1.524/sql/sql_parse.cc	2006-01-14 21:53:49 +02:00
@@ -2409,24 +2409,26 @@
       DBUG_RETURN(0);
     }
   }
-  else
+  else {
 #endif /* HAVE_REPLICATION */
-
-  /*
-    When option readonly is set deny operations which change non-temporary
-    tables. Except for the replication thread and the 'super' users.
-  */
-  if (opt_readonly &&
-      !(thd->security_ctx->master_access & SUPER_ACL) &&
-      uc_update_queries[lex->sql_command] &&
-      !((lex->sql_command == SQLCOM_CREATE_TABLE) &&
-        (lex->create_info.options & HA_LEX_CREATE_TMP_TABLE)) &&
-      ((lex->sql_command != SQLCOM_UPDATE_MULTI) &&
-       some_non_temp_table_to_be_updated(thd, all_tables)))
-  {
-    my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--read-only");
-    DBUG_RETURN(-1);
-  }
+    /*
+      When option readonly is set deny operations which change non-temporary
+      tables. Except for the replication thread and the 'super' users.
+    */
+    if (opt_readonly &&
+	!(thd->security_ctx->master_access & SUPER_ACL) &&
+	uc_update_queries[lex->sql_command] &&
+	!((lex->sql_command == SQLCOM_CREATE_TABLE) &&
+	  (lex->create_info.options & HA_LEX_CREATE_TMP_TABLE)) &&
+	((lex->sql_command != SQLCOM_UPDATE_MULTI) &&
+	 some_non_temp_table_to_be_updated(thd, all_tables)))
+    {
+      my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--read-only");
+      DBUG_RETURN(-1);
+    }
+#ifdef HAVE_REPLICATION
+  } /* endif unlikely slave */
+#endif
   if(lex->orig_sql_command == SQLCOM_END)
     statistic_increment(thd->status_var.com_stat[lex->sql_command],
                         &LOCK_status);
@@ -3227,8 +3229,7 @@
     else
       res= 0;
 
-    if ((res= mysql_multi_update_prepare(thd)))
-      break;
+    mysql_multi_update_prepare(thd);
 
 #ifdef HAVE_REPLICATION
     /* Check slave filtering rules */
@@ -3236,20 +3237,29 @@
     {
       if (all_tables_not_ok(thd, all_tables))
       {
+	res= 0;             /* don't care, filters are of highest prior */
+        thd->clear_error(); /* since !res we may do that                */
         /* we warn the slave SQL thread */
         my_error(ER_SLAVE_IGNORED_TABLE, MYF(0));
         break;
       }
+      if (res)
+        break;
     }
-    else
+    else {
 #endif /* HAVE_REPLICATION */
-    if (opt_readonly &&
-        !(thd->security_ctx->master_access & SUPER_ACL) &&
-        some_non_temp_table_to_be_updated(thd, all_tables))
-    {
-      my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--read-only");
-      break;
-    }
+      if (res)
+        break;
+      if (opt_readonly &&
+	  !(thd->security_ctx->master_access & SUPER_ACL) &&
+	  some_non_temp_table_to_be_updated(thd, all_tables))
+      {
+	my_error(ER_OPTION_PREVENTS_STATEMENT, MYF(0), "--read-only");
+	break;
+      }
+#ifdef HAVE_REPLICATION
+    }  /* unlikely */
+#endif
 
     res= mysql_multi_update(thd, all_tables,
                             &select_lex->item_list,
--- New file ---
+++ mysql-test/r/rpl_multi_update4.result	06/01/14 21:53:49
stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
start slave;
drop database if exists d1;
drop database if exists d2;
drop database if exists d2;
create database d1;
create database d2;
use d2;
create table t1 (id int);
create table t2 (id int);
insert into t1 values (1), (2), (3), (4), (5);
insert into t2 select id + 3 from t1;
update t1 join t2 using (id) set t1.id = 0;
show slave status;
Slave_IO_State	Master_Host	Master_User	Master_Port	Connect_Retry	Master_Log_File	Read_Master_Log_Pos	Relay_Log_File	Relay_Log_Pos	Relay_Master_Log_File	Slave_IO_Running	Slave_SQL_Running	Replicate_Do_DB	Replicate_Ignore_DB	Replicate_Do_Table	Replicate_Ignore_Table	Replicate_Wild_Do_Table	Replicate_Wild_Ignore_Table	Last_Errno	Last_Error	Skip_Counter	Exec_Master_Log_Pos	Relay_Log_Space	Until_Condition	Until_Log_File	Until_Log_Pos	Master_SSL_Allowed	Master_SSL_CA_File	Master_SSL_CA_Path	Master_SSL_Cert	Master_SSL_Cipher	Master_SSL_Key	Seconds_Behind_Master
Waiting for master to send event	127.0.0.1	root	9306	1	master-bin.000001	185	slave-relay-bin.000003	323	master-bin.000001	Yes	Yes					d1.%		0		0	185	323	None		0	No						0
drop database d1;
drop database d2;

--- New file ---
+++ mysql-test/t/rpl_multi_update4-slave.opt	06/01/14 21:53:50
--replicate-wild-do-table=d1.%


--- New file ---
+++ mysql-test/t/rpl_multi_update4.test	06/01/14 21:53:50
# Let's verify that multi-update is not always skipped by slave if
# some replicate-* rules exist.
# (BUG#15699)

source include/master-slave.inc;

### Clean-up

connection master;
--disable_warnings
drop database if exists d1;
drop database if exists d2;

connection slave;
drop database if exists d2;
--enable_warnings

### Test

connection master;
create database d1;      # accepted by slave
create database d2;      # ignored  by slave
use d2;
create table t1 (id int);
create table t2 (id int);
insert into t1 values (1), (2), (3), (4), (5);
insert into t2 select id + 3 from t1;
update t1 join t2 using (id) set t1.id = 0;

connection slave;
show slave status;        # must be ok

### Clean-up
connection master;
drop database d1;
drop database d2;


# End of 4.1 tests


--- 1.213/BitKeeper/etc/ignore	2006-01-11 01:05:07 +02:00
+++ 1.214/BitKeeper/etc/ignore	2006-01-14 22:06:46 +02:00
@@ -1272,3 +1272,5 @@
 client/my_user.c
 libmysqld/my_user.c
 sql/my_user.c
+sql/sql_parse.cc.orig
+sql/sql_parse.cc.sav
Thread
bk commit into 5.0 tree (aelkin:1.2018) BUG#15699Andrei Elkin14 Jan