Bug #14073 RBR: Different table definitions on master and slave crashes slave
Submitted: 17 Oct 2005 14:47 Modified: 26 Oct 2005 18:28
Reporter: Mats Kindahl Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Row Based Replication ( RBR ) Severity:S2 (Serious)
Version:5.0-wl1012 OS:Any (ALL)
Assigned to: Mats Kindahl CPU Architecture:Any

[17 Oct 2005 14:47] Mats Kindahl
Description:
If the definition of a table on the master and the slave does not match, the slave will crash.

How to repeat:
master> create table t1 (a int primary key, b int);
Query OK, 0 rows affected (0.42 sec)

slave> start slave;
Query OK, 0 rows affected (0.01 sec)

slave> alter table t1 add x int;
Query OK, 0 rows affected (0.08 sec)
Records: 0  Duplicates: 0  Warnings: 0

master> insert into t1 values (1,2);
Query OK, 1 row affected (0.00 sec)

slave> show slave status\G
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/home/bk/table-mysql-5.0-wl1012/mysql-test/var/tmp/slave.sock' (111)
ERROR: 
Can't connect to the server

Suggested fix:
The slave should not crash if it cannot handle matching table definitions. The bug is fixed by checking the table definition when a table map event is seen and comparing it with the definition available in the slave.
[26 Oct 2005 16:28] Guilhem Bichot
approved by Lars and me