Bug #42367 | CREATE/DROP/ALTER EVENT does not work with --replicate-rewrite-db | ||
---|---|---|---|
Submitted: | 27 Jan 2009 10:56 | Modified: | 3 Mar 2009 21:37 |
Reporter: | Johan Idrén | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S2 (Serious) |
Version: | 5.1.30 | OS: | Any |
Assigned to: | Luis Soares | CPU Architecture: | Any |
[27 Jan 2009 10:56]
Johan Idrén
[3 Mar 2009 21:27]
Luis Soares
Setting default database before creating the event makes the event to be successfully created on the rewritten database on the slave. Example: 1. Slave is started with --replicate-rewrite-db="bug_42367->bug_42367_slave" 2. On Master: use bug_42367; CREATE EVENT e2 ON SCHEDULE EVERY 1 DAY STARTS curdate() + INTERVAL '8:07' HOUR_MINUTE DO SELECT 1; 3. On Slave: show events from bug_42367_slave; Db Name Definer Time zone ... bug_42367_slave e2 @ SYSTEM ...
[3 Mar 2009 21:37]
Luis Soares
This does not seem like a bug. Going through the manual, documentation on "--replicate-rewrite-db" shows: "Tells the slave to translate the default database (that is, the one selected by USE) to to_name if it was from_name on the master. Only statements involving tables are affected (not statements such as CREATE DATABASE, DROP DATABASE, and ALTER DATABASE), and only if from_name is the default database on the master. (...)" Reference: http://dev.mysql.com/doc/refman/5.1/en/replication-options-slave.html Since the rewrite db is only supposed to work with default database selected (using the USE command), the presented case above, in the "how to repeat" section, fails. However, if default database is correctly set on the master before "create event" is issued, then the operation succeeds, meaning that the event is successfully created in the correct database on the slave. If you think I missed something in my analysis (check also comments before this one), please point it out and reopen the bug.
[4 Mar 2009 10:06]
Johan Idrén
I agree. I was mistaken, not a bug. The behavior is the same as any other operation using --replicate-rewrite-db