Bug #1240 slave of slave breaks when STOP SLAVE was issud on parent slave and temp tables
Submitted: 10 Sep 2003 9:40 Modified: 6 Nov 2003 6:38
Reporter: Guilhem Bichot Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Replication Severity:S2 (Serious)
Version:4.0 OS:Any (all)
Assigned to: Guilhem Bichot CPU Architecture:Any

[10 Sep 2003 9:40] Guilhem Bichot
see how-to-repeat.

How to repeat:
set up a master, slave1 a slave of master, slave2 slave of slave1.
slave1 should run with --log-bin and --log-slave-updates.
create temporary table t(a int)
on master;
stop slave; start slave; on slave1;
insert into t values(1)
on master.
Then in slave1's binlog you will have something like:
thread_id=1 ; create temporary table t(a int);
thread_id=2 ; insert into t values(1);

So slave2 will be confused because it will think 't' is not the same table in both queries (because of the changing thread id). So slave2 will say "unknown table t" when playing the second query.
A related problem: in 4.1 'mysqlbinlog|mysql' is supposed to work well with temp tables, but here it will make 'mysql' fail (because "SET pseudo_thread_id=1" will be printed for first query, and "SET pseudo_thread_id=2" for second query),  so there will be an "unknown table".
[27 Sep 2003 13:32] Guilhem Bichot
no changeset; sent a patch for review.
[29 Oct 2003 5:24] Guilhem Bichot
Better proposed patch (which fixes BUG#1686 as well) is in 
ChangeSet@1.1583, 2003-10-29 14:23:35+01:00, guilhem@mysql.com
[6 Nov 2003 6:38] Guilhem Bichot
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at

ChangeSet@1.1608.1.1, 2003-11-03 18:24:01+01:00, guilhem@mysql.com