List:Commits« Previous MessageNext Message »
From:Dao-Gang.Qu Date:January 6 2010 3:07am
Subject:bzr push into mysql-5.0-bugteam branch (Dao-Gang.Qu:2834 to 2835) Bug#49137
View as plain text  
 2835 Dao-Gang.Qu@stripped	2010-01-06
      Bug #49137  	Replication failure on SBR/MBR + multi-table DROP TEMPORARY TABLE
      
      Fixed valgrind failure on PB2.
     @ sql/log_event.cc
        Added code to fix valgrind failure on PB2.

    modified:
      sql/log_event.cc
 2834 Dao-Gang.Qu@stripped	2009-12-31
      Bug #49137  	Replication failure on SBR/MBR + multi-table DROP TEMPORARY TABLE
            
      In statement-based or mixed-mode replication, use DROP TEMPORARY TABLE
      to drop multiple tables causes different errors on master and slave, 
      when one or more of these tables do not exist. Because when executed
      on slave, it would automatically add IF EXISTS to the query to ignore
      all ER_BAD_TABLE_ERROR errors.
      
      To fix the problem, do not add IF EXISTS when executing DROP TEMPORARY
      TABLE on the slave, and clear the ER_BAD_TABLE_ERROR error after
      execution if the query does not expect any errors.
     @ mysql-test/r/rpl_drop_temp.result
        Updated for the patch of bug#49137.
     @ mysql-test/t/rpl_drop_temp.test
        Added the test file to verify if DROP MULTI TEMPORARY TABLE
        will cause different errors on master and slave, when one or
        more of these tables do not exist.
     @ sql/log_event.cc
        Added code to handle above cases which are
        removed from sql_parse.cc
     @ sql/sql_parse.cc
        Remove the code to issue the 'Unknown table' error,
        if the temporary table does not exist when dropping
        it on slave. The above cases decribed in comments
        will be handled later in log_event.cc.

    modified:
      mysql-test/r/rpl_drop_temp.result
      mysql-test/t/rpl_drop_temp.test
      sql/log_event.cc
      sql/sql_parse.cc
=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc	2009-12-31 03:33:10 +0000
+++ b/sql/log_event.cc	2010-01-06 02:36:29 +0000
@@ -2110,8 +2110,8 @@ compare_errors:
       has already been dropped. To ignore such irrelevant "table does
       not exist errors", we silently clear the error if TEMPORARY was used.
     */
-    if (thd->lex->drop_temporary &&
-        thd->net.last_errno == ER_BAD_TABLE_ERROR && !expected_error)
+    if (thd->net.last_errno == ER_BAD_TABLE_ERROR &&
+        !expected_error && thd->lex->drop_temporary)
       thd->clear_error();
     /*
       If we expected a non-zero error code, and we don't get the same error


Attachment: [text/bzr-bundle] bzr/dao-gang.qu@sun.com-20100106023629-wxptj8yeqlektus8.bundle
Thread
bzr push into mysql-5.0-bugteam branch (Dao-Gang.Qu:2834 to 2835) Bug#49137Dao-Gang.Qu6 Jan