List:Commits« Previous MessageNext Message »
From:cbell Date:May 8 2007 1:28pm
Subject:bk commit into 5.1 tree (cbell:1.2576) BUG#17233
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of cbell. When cbell does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-05-08 09:28:19-04:00, cbell@mysql_cab. +3 -0
  BUG#17233 : LOAD DATA INFILE: failure causes mysqld dbug_assert, binlog not flushed 
  
  This patch corrects a bug involving a LOAD DATA INFILE operation on a 
  transactional table. It corrects a problem in the error handler moving
  the transactional table check and autocommit_or_rollback operation to the 
  end of the error handler. An additional test case was added to detect this
  condition.

  mysql-test/extra/rpl_tests/rpl_loaddata.test@stripped, 2007-05-08 09:28:07-04:00, cbell@mysql_cab. +12 -0
    BUG#17233 : LOAD DATA INFILE: failure causes mysqld dbug_assert, binlog not flushed 
        
    This patch adds an additional test to rpl_loaddata for handling the
    duplicate key error on LOAD DATA INFILE.

  mysql-test/r/rpl_loaddata.result@stripped, 2007-05-08 09:28:08-04:00, cbell@mysql_cab. +4 -0
    BUG#17233 : LOAD DATA INFILE: failure causes mysqld dbug_assert, binlog not flushed 
        
    This patch adds the results for the additional test for properly handling the
    duplicate key error on LOAD DATA INFILE.

  sql/sql_load.cc@stripped, 2007-05-08 09:28:08-04:00, cbell@mysql_cab. +3 -3
    BUG#17233 : LOAD DATA INFILE: failure causes mysqld dbug_assert, binlog not flushed 
    
    This patch moves the check for a transactional table and rollback in the
    error handler for mysql_load(). The patch moves the transactional table
    check to the end of the error handler matching the implementation for other
    similar operations (see sql_insert).

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	cbell
# Host:	mysql_cab.
# Root:	C:/source/c++/mysql-5.1_BUG_17233

--- 1.123/sql/sql_load.cc	2007-05-08 09:28:44 -04:00
+++ 1.124/sql/sql_load.cc	2007-05-08 09:28:44 -04:00
@@ -413,9 +413,6 @@ bool mysql_load(THD *thd,sql_exchange *e
 
   if (error)
   {
-    if (transactional_table)
-      ha_autocommit_or_rollback(thd,error);
-
     if (read_file_from_client)
       while (!read_info.next_line())
 	;
@@ -463,6 +460,9 @@ bool mysql_load(THD *thd,sql_exchange *e
       }
     }
 #endif /*!EMBEDDED_LIBRARY*/
+    if (transactional_table)
+      ha_autocommit_or_rollback(thd,error);
+
     error= -1;				// Error on read
     goto err;
   }

--- 1.6/mysql-test/extra/rpl_tests/rpl_loaddata.test	2007-05-08 09:28:44 -04:00
+++ 1.7/mysql-test/extra/rpl_tests/rpl_loaddata.test	2007-05-08 09:28:44 -04:00
@@ -15,6 +15,7 @@
 # Last_slave_errno in SHOW SLAVE STATUS (1st and 3rd commands did not: bug 986)
 
 -- source include/master-slave.inc
+source include/have_innodb.inc;
 
 connection slave;
 reset master;
@@ -156,4 +157,15 @@ drop table t2;
 connection master;
 drop table t2;
 drop table t1;
+
+# BUG#17233 LOAD DATA INFILE: failure causes mysqld dbug_assert, binlog not flushed
+CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
+
+--error ER_DUP_ENTRY_WITH_KEY_NAME
+LOAD DATA INFILE "../std_data_ln/words.dat" INTO TABLE t1;
+
+--disable warnings
+DROP TABLE IF EXISTS t1;
+--enable warnings
+
 # End of 4.1 tests

--- 1.41/mysql-test/r/rpl_loaddata.result	2007-05-08 09:28:44 -04:00
+++ 1.42/mysql-test/r/rpl_loaddata.result	2007-05-08 09:28:44 -04:00
@@ -86,3 +86,7 @@ ERROR 23000: Duplicate entry '2003-03-22
 drop table t2;
 drop table t2;
 drop table t1;
+CREATE TABLE t1 (word CHAR(20) NOT NULL PRIMARY KEY) ENGINE=INNODB;
+LOAD DATA INFILE "../std_data_ln/words.dat" INTO TABLE t1;
+ERROR 23000: Duplicate entry 'Aarhus' for key 'PRIMARY'
+DROP TABLE IF EXISTS t1;

Thread
bk commit into 5.1 tree (cbell:1.2576) BUG#17233cbell8 May