Bug #45581 Test rpl_row_sp006_InnoDB fails randomly: Unknown database 'mysqltest1'
Submitted: 18 Jun 2009 7:49 Modified: 19 Dec 2009 10:14
Reporter: Zhenxing He Email Updates:
Status: Closed Impact on me:
None 
Category:Tests: Replication Severity:S3 (Non-critical)
Version:5.1,5.4 OS:Any
Assigned to: Libing Song CPU Architecture:Any
Tags: pb2, test

[18 Jun 2009 7:49] Zhenxing He
Description:
Test rpl_row_sp006_InnoDB fails randomly like this:

rpl.rpl_row_sp006_InnoDB                 w2 [ fail ]
        Test ended at 2009-06-05 11:49:39

CURRENT_TEST: rpl.rpl_row_sp006_InnoDB
=== SHOW MASTER STATUS ===
---- 1. ----
File	slave-bin.000001
Position	502
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

[ snip ]

Last_Error	Error 'Unknown database 'mysqltest1'' on query.

How to repeat:
Check this:

http://pb2.norway.sun.com/web.py?template=mysql_show_test_failure&test_failure_id=2195558

Suggested fix:
Because of Bug #45574(CREATE IF NOT EXISTS is not binlogged if the object exists), I'd suggest to fix it by this before fix of that bug:

=== modified file 'mysql-test/extra/rpl_tests/rpl_row_sp006.test'
--- a/mysql-test/extra/rpl_tests/rpl_row_sp006.test     2007-06-18 13:36:10 +0000
+++ b/mysql-test/extra/rpl_tests/rpl_row_sp006.test     2009-06-18 04:03:12 +0000
@@ -11,12 +11,14 @@
 # Begin clean up test section
 connection master;
 --disable_warnings
-create database if not exists mysqltest1;
+drop database if exists mysqltest1;
+create database mysqltest1;
 DROP PROCEDURE IF EXISTS mysqltest1.p1;
 DROP PROCEDURE IF EXISTS mysqltest1.p2;
 DROP TABLE IF EXISTS mysqltest1.t2;
[24 Aug 2009 10:10] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/81395

3078 Li-Bing.Song@sun.com	2009-08-24
      BUG#45581 Test rpl_row_sp006_InnoDB fails randomly: Unknown database 'mysqltest1'
      
      Essentially, Bug#45574 results in this bug. CREATE TABLE IF NOT EXISTS was not 
      binlogged, when the table has existed.
      Sometimes, the test master and test slave are not synchronous. The db 'mysqltest1' has existed
      when we starts this test case.So CREATE TABLE IF NOT EXISTS mysqltest1 is not binlogged.
      mysqltest1 is not exists on slave.
      
      Patch of Bug#45574 has resolved this problem. But I think it is better to drop the db 'mysqltest1' 
      at the begin of this test.
[28 Aug 2009 3:41] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/81789

3078 Li-Bing.Song@sun.com	2009-08-28
      BUG#45581 Test rpl_row_sp006_InnoDB fails randomly: Unknown database 'mysqltest1'
      
      Essentially, Bug#45574 results in this bug. 
      The "CREATE TABLE IF NOT EXISTS ..." sentence is not binlogged if the table exists.
      Sometimes, the master and slave become inconsistent. 
      The "CREATE TABLE IF NOT EXISTS mysqltest1" sentence is not binlogged 
      if the db 'mysqltest1' has existed before test case is excuted.
      So the db 'mysqltest1' can't be created on slave.
      
      Patch of Bug#45574 has resolved this problem. But I think it is better to drop the db 'mysqltest1' 
      at the begin of this test.
[2 Sep 2009 11:26] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/82204

3079 Li-Bing.Song@sun.com	2009-09-02
      BUG#45581 Test rpl_row_sp006_InnoDB fails randomly: Unknown database 'mysqltest1'
      
      Essentially, Bug#45574 results in this bug. The 'CREATE DATABASE IF NOT EXISTS' statement was not 
      binlogged, when the database has existed.
      Sometimes, the master and slaves become inconsistent. The "CREATE DATABASE
      IF NOT EXISTS mysqltest1" statement is not binlogged
      if the db 'mysqltest1' existed before the test case is executed. 
      So the db 'mysqltest1' can't be created on slave.
      
      Patch of Bug#45574 has resolved this problem. 
      But I think it is better to replace 'mysqltest1' by default db 'test'.
[3 Sep 2009 9:05] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/82293

3105 Li-Bing.Song@sun.com	2009-09-03
      BUG#45581 Test rpl_row_sp006_InnoDB fails randomly: Unknown database 'mysqltest1'
            
      Essentially, Bug#45574 results in this bug. The 'CREATE DATABASE IF NOT EXISTS' statement was not 
      binlogged, when the database has existed.
      Sometimes, the master and slaves become inconsistent. The "CREATE DATABASE
      IF NOT EXISTS mysqltest1" statement is not binlogged
      if the db 'mysqltest1' existed before the test case is executed. 
      So the db 'mysqltest1' can't be created on slave.
           
      Patch of Bug#45574 has resolved this problem. 
      But I think it is better to replace 'mysqltest1' by default db 'test'.
[4 Sep 2009 1:36] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/82388

3107 Li-Bing.Song@sun.com	2009-09-04
      BUG#45581 Test rpl_row_sp006_InnoDB fails randomly: Unknown database 'mysqltest1'
            
      Essentially, Bug#45574 results in this bug. The 'CREATE DATABASE IF NOT EXISTS' statement was not 
      binlogged, when the database has existed.
      Sometimes, the master and slaves become inconsistent. The "CREATE DATABASE
      IF NOT EXISTS mysqltest1" statement is not binlogged
      if the db 'mysqltest1' existed before the test case is executed. 
      So the db 'mysqltest1' can't be created on slave.
           
      Patch of Bug#45574 has resolved this problem. 
      But I think it is better to replace 'mysqltest1' by default db 'test'.
[5 Sep 2009 9:04] Libing Song
Pushed to mysql-5.1-bugteam and mysql-pe
[7 Sep 2009 5:03] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/82540

3114 Li-Bing.Song@sun.com	2009-09-07
      Bug#45581 Test rpl_row_sp006_InnoDB fails randomly: Unknown database 'mysqltest1'
      
      Postfix.
      extra/rpl_tests/rpl_row_sp006.test had changed to fix this bug.
      extra/rpl_tests/rpl_row_sp006.test is also referenced by rpl_ndb_sp006,
      So rpl_row_sp006.result must be changed too.
[14 Sep 2009 16:02] Bugs System
Pushed into 5.4.4-alpha (revid:alik@sun.com-20090914155317-m1g9wodmndzdj4l1) (version source revid:alik@sun.com-20090914155317-m1g9wodmndzdj4l1) (merge vers: 5.4.4-alpha) (pib:11)
[15 Sep 2009 7:12] Jon Stephens
Test case only; nothing to document for end users. Closed without further action.
[6 Oct 2009 8:59] Bugs System
Pushed into 5.1.40 (revid:joro@sun.com-20091006073316-lea2cpijh9r6on7c) (version source revid:mikael@mysql.com-20090907102257-fflwgm6rp5m5kmfw) (merge vers: 5.1.39) (pib:11)
[18 Dec 2009 10:25] Bugs System
Pushed into 5.1.41-ndb-7.1.0 (revid:jonas@mysql.com-20091218102229-64tk47xonu3dv6r6) (version source revid:jonas@mysql.com-20091218095730-26gwjidfsdw45dto) (merge vers: 5.1.41-ndb-7.1.0) (pib:15)
[18 Dec 2009 10:41] Bugs System
Pushed into 5.1.41-ndb-6.2.19 (revid:jonas@mysql.com-20091218100224-vtzr0fahhsuhjsmt) (version source revid:jonas@mysql.com-20091217101452-qwzyaig50w74xmye) (merge vers: 5.1.41-ndb-6.2.19) (pib:15)
[18 Dec 2009 10:57] Bugs System
Pushed into 5.1.41-ndb-6.3.31 (revid:jonas@mysql.com-20091218100616-75d9tek96o6ob6k0) (version source revid:jonas@mysql.com-20091217154335-290no45qdins5bwo) (merge vers: 5.1.41-ndb-6.3.31) (pib:15)
[18 Dec 2009 11:11] Bugs System
Pushed into 5.1.41-ndb-7.0.11 (revid:jonas@mysql.com-20091218101303-ga32mrnr15jsa606) (version source revid:jonas@mysql.com-20091218064304-ezreonykd9f4kelk) (merge vers: 5.1.41-ndb-7.0.11) (pib:15)
[19 Dec 2009 10:14] Jon Stephens
Closed. See my previous comment.