mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Fix for BUG#2527 "Multi-Table Delete - Not Replication use replicate-wild-do-table"
(as long as replicate-*-table rules were defined, multi-table DELETE was never replicated by the slave).
This commit is contained in:
22
mysql-test/r/rpl_multi_delete.result
Normal file
22
mysql-test/r/rpl_multi_delete.result
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
slave stop;
|
||||||
|
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;
|
||||||
|
slave start;
|
||||||
|
create table t1 (a int);
|
||||||
|
create table t2 (a int);
|
||||||
|
insert into t1 values (1);
|
||||||
|
insert into t2 values (1);
|
||||||
|
delete t1.* from t1, t2 where t1.a = t2.a;
|
||||||
|
select * from t1;
|
||||||
|
a
|
||||||
|
select * from t2;
|
||||||
|
a
|
||||||
|
1
|
||||||
|
select * from t1;
|
||||||
|
a
|
||||||
|
select * from t2;
|
||||||
|
a
|
||||||
|
1
|
||||||
|
drop table t1,t2;
|
1
mysql-test/t/rpl_multi_delete-slave.opt
Normal file
1
mysql-test/t/rpl_multi_delete-slave.opt
Normal file
@ -0,0 +1 @@
|
|||||||
|
--replicate-wild-do-table=test.%
|
23
mysql-test/t/rpl_multi_delete.test
Normal file
23
mysql-test/t/rpl_multi_delete.test
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
source include/master-slave.inc;
|
||||||
|
create table t1 (a int);
|
||||||
|
create table t2 (a int);
|
||||||
|
|
||||||
|
insert into t1 values (1);
|
||||||
|
insert into t2 values (1);
|
||||||
|
|
||||||
|
delete t1.* from t1, t2 where t1.a = t2.a;
|
||||||
|
|
||||||
|
save_master_pos;
|
||||||
|
select * from t1;
|
||||||
|
select * from t2;
|
||||||
|
|
||||||
|
connection slave;
|
||||||
|
sync_with_master;
|
||||||
|
select * from t1;
|
||||||
|
select * from t2;
|
||||||
|
|
||||||
|
connection master;
|
||||||
|
drop table t1,t2;
|
||||||
|
save_master_pos;
|
||||||
|
connection slave;
|
||||||
|
sync_with_master;
|
@ -1334,7 +1334,9 @@ mysql_execute_command(void)
|
|||||||
Skip if we are in the slave thread, some table rules have been
|
Skip if we are in the slave thread, some table rules have been
|
||||||
given and the table list says the query should not be replicated
|
given and the table list says the query should not be replicated
|
||||||
*/
|
*/
|
||||||
if (table_rules_on && tables && !tables_ok(thd,tables))
|
if (table_rules_on && tables && !tables_ok(thd,tables) &&
|
||||||
|
((lex->sql_command != SQLCOM_DELETE_MULTI) ||
|
||||||
|
!tables_ok(thd,(TABLE_LIST *)thd->lex.auxilliary_table_list.first)))
|
||||||
{
|
{
|
||||||
/* we warn the slave SQL thread */
|
/* we warn the slave SQL thread */
|
||||||
my_error(ER_SLAVE_IGNORED_TABLE, MYF(0));
|
my_error(ER_SLAVE_IGNORED_TABLE, MYF(0));
|
||||||
|
Reference in New Issue
Block a user