Bug #6864 ALTER TABLE RENAME TO not written to binary log?
Submitted: 28 Nov 2004 19:18 Modified: 29 Dec 2004 10:03
Reporter: Brian Bray Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Replication Severity:S3 (Non-critical)
Version:4.1.7 OS:Linux (Linux)
Assigned to: Assigned Account CPU Architecture:Any

[28 Nov 2004 19:18] Brian Bray
Description:
I renamed an old table and recreated it by using: ALTER TABLE bt_hits_archive RENAME TO bt_hits_prehistoric and then recreated it using:
CREATE TABLE bt_hits_achive ...

My replication slave choked on the CREATE TABLE saying that the table already existed.  I manually reissued the ALTER TABLE command on the slave and restarted the slave and all seemed well.  Could the ALTER TABLE RENAME TO command not be making it into the binary log?  

How to repeat:
041128 11:53:19 [ERROR] Slave: Error 'Table 'bt_hits_archive' already exists' on
 query. Default database: 'bookmarkdb'. Query: 'CREATE TABLE `bt_hits_archive` (

  `ht_us_id` int(11) default NULL,
  `ht_date` date default NULL,
  `ht_time` time default NULL,
  `ht_remote_addr` varchar(85) default NULL,
  `ht_path` varchar(85) default NULL,
  `ht_query_string` varchar(85) default NULL,
  `ht_id` int(11) NOT NULL,
  `ht_ticks` int(11) default NULL,
  `ht_se_id` int(11) default NULL,
  `ht_br_id` int(11) default '1',
  PRIMARY KEY  (`ht_id`),
  KEY `userId` (`ht_us_id`)
) ENGINE=MyISAM', Error_code: 1050
041128 11:53:19 [ERROR] Error running query, slave SQL thread aborted. Fix the problem, and restart the slave SQL thread with "SLAVE START". We stopped at log ' ns-bin.000016' position 1601684

I do have a couple replicate_ignore_table's defined, but for a different table:
            Replicate_Do_DB: bookmarkdb
        Replicate_Ignore_DB:
         Replicate_Do_Table:
     Replicate_Ignore_Table: bookmarkdb.bt_folders_dmoz,bookmarkdb.bt_bookmarks_
dmoz
    Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
[29 Nov 2004 10:03] Hartmut Holzgraefe
I can see ALTER TABLE ... RENAME statements being written to the binlog just fine.
Could you plese check your binlog using the mysqlbinlog utility to see whether it is
written in your case or not?
[14 Feb 2005 22:54] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".