Bug #11208 Slave replicated create database should be ingnored if database already exists
Submitted: 9 Jun 2005 14:34 Modified: 7 Jul 2005 6:19
Reporter: Jonathan Miller Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Replication Severity:S2 (Serious)
Version:5.1.0-wl2325-wl1354-new OS:Linux (Linux)
Assigned to: Mats Kindahl CPU Architecture:Any

[9 Jun 2005 14:34] Jonathan Miller
Description:
Not sure if this is a replication or a cluster bug, but replication should not come to a stop if a database already exists. Customers may want to reprocess from Master bin log, but are stopped dead in thier tracks when a create statment for a database comes accross for one that already exists.
                 Last_Errno: 1007
                 Last_Error: Error 'Can't create database 'BANK'; database exists' on query. Default database: 'BANK'. Query: 'CREATE DATABASE BANK'

The create table statement puts out the following:
050609  1:58:03 [ERROR] NDB_SHARE: ./BANK/ACCOUNT already exists, use_count=1. Moving away for safety, but possible memleak.

I have also seen the above database create error on cluster_replication.binlog_index, but have not gotten it down to a reproducable test case.

How to repeat:
Create Bank on master and on slave, start slave.

Suggested fix:
Replication ignores create database failures because the database already exists.
[13 Jun 2005 15:29] Jonathan Miller
Another example:

Start test running on master cluster today. Went to start slave cluster and received the following:

 Last_Errno: 1050
                 Last_Error: Error 'Table 'db' already exists' on query. Default database: 'mysql'. Query: ' CREATE TABLE db (   Host char(60) binary DEFAULT '' NOT NULL,   Db char(64) binary DEFAULT '' NOT NULL,   User char(16) binary DEFAULT '' NOT NULL,   Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,   Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,   Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,   Delete_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,   Create_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,   Drop_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,   Grant_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,   References_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,   Index_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,   Alter_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,   Create_tmp_table_priv enum('N','Y') COLLATE utf8_gener