From f89424f8b69d50fb26c0af3d226ac20afe2a32da Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Sep 2005 06:31:38 -0600 Subject: fix for BUG#11139 (multi-delete with alias breaking replication if table rules are present): the problem originally was that the tables in auxilliary_tables did not have the correct real_name, which caused problems in the second call to tables_ok(). The fix corrects the real_name problem, and also sets the updating flag properly, which makes the second call to tables_ok() unnecessary. mysql-test/r/rpl_multi_delete2.result: updates for for BUG#11139 mysql-test/t/rpl_multi_delete2-slave.opt: updates for for BUG#11139 mysql-test/t/rpl_multi_delete2.test: updates for for BUG#11139 sql/mysql_priv.h: fix for BUG#11139 (multi-delete with alias breaking replication if table rules are present) sql/slave.cc: fix for BUG#11139 (multi-delete with alias breaking replication if table rules are present) sql/sql_parse.cc: fix for BUG#11139 (multi-delete with alias breaking replication if table rules are present) sql/sql_yacc.yy: fix for BUG#11139 (multi-delete with alias breaking replication if table rules are present) --- sql/slave.cc | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'sql/slave.cc') diff --git a/sql/slave.cc b/sql/slave.cc index 9ff7a432b89..1be3e3b4a17 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -746,14 +746,7 @@ static TABLE_RULE_ENT* find_wild(DYNAMIC_ARRAY *a, const char* key, int len) rules (see code below). For that reason, users should not set conflicting rules because they may get unpredicted results (precedence order is explained in the manual). - If no table of the list is marked "updating" (so far this can only happen - if the statement is a multi-delete (SQLCOM_DELETE_MULTI) and the "tables" - is the tables in the FROM): then we always return 0, because there is no - reason we play this statement on this slave if it updates nothing. In the - case of SQLCOM_DELETE_MULTI, there will be a second call to tables_ok(), - with tables having "updating==TRUE" (those after the DELETE), so this - second call will make the decision (because - all_tables_not_ok() = !tables_ok(1st_list) && !tables_ok(2nd_list)). + RETURN VALUES 0 should not be logged/replicated -- cgit v1.2.1 From 84f029a448fc822f2fa150ab13e61b233b1e4027 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 15 Sep 2005 22:29:07 +0300 Subject: WL#2787 (part 2, ver 3 (merged)) changed securety context switching libmysqld/lib_sql.cc: changed securety context switching mysql-test/r/rpl_sp.result: now it show real information from changed security context of SP (checked) sql/ha_innodb.cc: changed securety context switching sql/item.cc: changed securety context switching sql/item_func.cc: changed securety context switching sql/item_strfunc.cc: changed securety context switching sql/log.cc: changed securety context switching sql/mysql_priv.h: changed securety context switching sql/mysqld.cc: changed securety context switching sql/repl_failsafe.cc: changed securety context switching sql/set_var.cc: changed securety context switching sql/slave.cc: changed securety context switching sql/sp.cc: changed securety context switching sql/sp_head.cc: changed securety context switching in case of inability to switch context we return error now sql/sp_head.h: changed securety context switching sql/sql_acl.cc: changed securety context switching sql/sql_acl.h: changed securety context switching sql/sql_base.cc: changed securety context switching sql/sql_class.cc: changed securety context switching sql/sql_class.h: changed securety context switching sql/sql_db.cc: changed securety context switching sql/sql_insert.cc: changed securety context switching sql/sql_parse.cc: changed securety context switching sql/sql_show.cc: changed securety context switching sql/sql_trigger.cc: changed securety context switching sql/sql_view.cc: changed securety context switching sql/sql_yacc.yy: changed securety context switching --- sql/slave.cc | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'sql/slave.cc') diff --git a/sql/slave.cc b/sql/slave.cc index d2a60076cef..7bbad84debb 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2809,17 +2809,10 @@ static int init_slave_thread(THD* thd, SLAVE_THD_TYPE thd_type) DBUG_ENTER("init_slave_thread"); thd->system_thread = (thd_type == SLAVE_THD_SQL) ? SYSTEM_THREAD_SLAVE_SQL : SYSTEM_THREAD_SLAVE_IO; - /* - The two next lines are needed for replication of SP (CREATE PROCEDURE - needs a valid user to store in mysql.proc). - */ - thd->priv_user= (char *) ""; - thd->priv_host[0]= '\0'; - thd->host_or_ip= ""; + thd->security_ctx->skip_grants(); thd->client_capabilities = 0; my_net_init(&thd->net, 0); thd->net.read_timeout = slave_net_timeout; - thd->master_access= ~(ulong)0; thd->slave_thread = 1; set_slave_thread_options(thd); /* -- cgit v1.2.1 From b2fa7d16c2df3c9212f52c29e549b7e893fc8662 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 4 Oct 2005 19:52:12 +0300 Subject: Fixed several boolean type options used in my_long_options[]. Some options were declared as 'bool', but since those are being handled in my_getopt.c, bool can be machine dependent. To make sure it works in all circumstances, the type should be my_bool for C (not C++) programs. sql/mysql_priv.h: Fixed some bools to my_bools. sql/mysqld.cc: Changed several bools to my_bools. sql/slave.cc: Changed bool to my_bool. sql/slave.h: Changed bool to my_bool. --- sql/slave.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sql/slave.cc') diff --git a/sql/slave.cc b/sql/slave.cc index 092fb40d9d9..b1763187d04 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -40,7 +40,8 @@ HASH replicate_do_table, replicate_ignore_table; DYNAMIC_ARRAY replicate_wild_do_table, replicate_wild_ignore_table; bool do_table_inited = 0, ignore_table_inited = 0; bool wild_do_table_inited = 0, wild_ignore_table_inited = 0; -bool table_rules_on= 0, replicate_same_server_id; +bool table_rules_on= 0; +my_bool replicate_same_server_id; ulonglong relay_log_space_limit = 0; /* -- cgit v1.2.1