Description:
There is next text at http://dev.mysql.com/doc/refman/4.1/en/replication-rules.html:
Stage 2. Check the table options.
If the slave reaches this point, it executes all statements if there are no table options. If there are “do” table options, the statement must match one of them if it is to be executed; otherwise, it is ignored. If there are any “ignore” options, all statements are executed except those that match any ignore option. The following steps describe how this evaluation occurs in more detail.
1. Are there any --replicate-*-table options?
* No: There are no table restrictions, so all statements match. Execute the statement and exit.
* Yes: There are table restrictions. Evaluate the tables to be updated against them. There might be multiple tables to update, so loop through the following steps for each table looking for a matching option (first the non-wild options, and then the wild options). Only tables that are to be updated are compared to the options. For example, if the statement is INSERT INTO sales SELECT * FROM prices, only sales is compared to the options). If several tables are to be updated (multiple-table statement), the first table that matches “do” or “ignore” wins. That is, the server checks the first table against the options. If no decision could be made, it checks the second table against the options, and so on.
But UPDATE ignores if one table is specified as argument of replicate_do_table option and other does not.
Version 5.x behaves as described.
How to repeat:
$cat rpl_bug-slave.opt:
--replicate_do_table=test.t1
$cat rpl_bug.test:
--source include/master-slave.inc
drop table if exists t1;
drop table if exists t2;
create table t1(id int);
create table t2(id int);
insert into t1 values (1),(2),(3),(4),(5);
insert into t2 values (1),(2),(3),(4),(5);
update t1 a join t2 b on a.id=b.id set a.id=2*a.id;
sleep 1;
connection slave;
show slave status;
Suggested fix:
Fix either version 4.1 or documentation for this version.