Bug #55468 Some statements binlogged follow the set of lower_case_table_name, some are not!
Submitted: 22 Jul 2010 5:49 Modified: 22 Jul 2010 6:27
Reporter: Daogang Qu Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:5.1, 5.5+ OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[22 Jul 2010 5:49] Daogang Qu
Description:
If you have lower_case_table_names=1 set on the master, some statements with
captain letters are binlogged as the original statements, but some are not.
Which will cause the replication break.

How to repeat:
rpl_filter.test:
-- source include/master-slave.inc
-- source include/have_binlog_format_statement.inc

CREATE DATABASE MYDB;
USE MYDB;

CREATE TABLE T1 (a INT);
INSERT INTO T1 VALUES (1);
DROP DATABASE MYDB;
-- sync_slave_with_master

rpl_filter-master.opt:
--lower_case_table_names=1

Error:
rpl.rpl_filters 'stmt'                 [ fail ]
        Test ended at 2010-07-22 13:16:56

CURRENT_TEST: rpl.rpl_do_filter
=== SHOW MASTER STATUS ===
---- 1. ----
File	slave-bin.000001
Position	190
Binlog_Do_DB	
Binlog_Ignore_DB	
==========================

=== SHOW SLAVE STATUS ===
---- 1. ----
Slave_IO_State	Waiting for master to send event
Master_Host	127.0.0.1
Master_User	root
Master_Port	13060
Connect_Retry	1
Master_Log_File	master-bin.000001
Read_Master_Log_Pos	582
Relay_Log_File	slave-relay-bin.000003
Relay_Log_Pos	337
Relay_Master_Log_File	master-bin.000001
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	1049
Last_Error	Error 'Unknown database 'mydb'' on query. Default database: 'mydb'. Query: 'CREATE TABLE T1 (a INT)'

Suggested fix:
Maybe all statements should be binlogged in the same way, follow
the set of lower_case_table_names or not.
[22 Jul 2010 6:27] Sveta Smirnova
Thank you for the report.

Verified as described.