Bug #51499 DDL statement not replicated
Submitted: 25 Feb 2010 10:39 Modified: 25 Mar 2010 10:37
Reporter: Bogdan Kecman Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Cluster: Replication Severity:S3 (Non-critical)
Version:7.0.10 OS:Any
Assigned to: Martin Skold CPU Architecture:Any

[25 Feb 2010 10:39] Bogdan Kecman
Description:
Not all DDL statements are replicated in cluster to cluster replication.

When you execute create table db.tablename ... it don't get replicated. If you do use db; create table tablename... then it works ok

How to repeat:
Slave:
mysql> STOP SLAVE;

Master:
mysql> create table db1.t2(a int auto_increment primary key, b int);
Query OK, 0 rows affected (0.34 sec)

mysql> insert into db1.t2 (b) values (1);
Query OK, 1 row affected (0.01 sec)

Slave:
mysql> start slave;
Query OK, 0 rows affected (0.00 sec)

mysql> show slave status \G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: master-mysqld-1
Master_User: slave
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: binlog.000005
Read_Master_Log_Pos: 1894
Relay_Log_File: mysqld-relay-bin.000013
Relay_Log_Pos: 250
Relay_Master_Log_File: binlog.000005
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 1146
Last_Error: Error 'Table 'db1.t2' doesn't exist' on opening tables
Skip_Counter: 0
Exec_Master_Log_Pos: 1561
Relay_Log_Space: 1338
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 1146
Last_SQL_Error: Error 'Table 'db1.t2' doesn't exist' on opening tables
Master_Bind:
1 row in set (0.00 sec)

If on master you execute
use db1;
create table t2(a int auto_increment primary key, b int);

then it works ok

Suggested fix:
replicate it.
[25 Mar 2010 10:35] Martin Skold
test file

Attachment: rpl_ndb_bug#51499.test (application/octet-stream, text), 556 bytes.

[25 Mar 2010 10:36] Martin Skold
result file

Attachment: rpl_ndb_bug#51499.result (application/octet-stream, text), 414 bytes.

[25 Mar 2010 10:37] Martin Skold
Can't reproduce this on current 7.0 tree.
Please see attached test case