diff options
author | unknown <cbell/Chuck@mysql_cab.> | 2007-05-08 10:17:00 -0400 |
---|---|---|
committer | unknown <cbell/Chuck@mysql_cab.> | 2007-05-08 10:17:00 -0400 |
commit | f508249f8b476646f2423bd33e76946ae36a5eca (patch) | |
tree | 25c50ba9b26f1480fbd7b632b6e4480a4731c345 /sql/sql_load.cc | |
parent | 4598bb9e8d99c581c9d936993592c3b0a3374c6d (diff) | |
download | mariadb-git-f508249f8b476646f2423bd33e76946ae36a5eca.tar.gz |
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 by moving
the transactional table check and autocommit_or_rollback operation to the
end of the error handler.
The problem was an assert was thrown after the operation completed. The
assert found a non-sunk event in the transaction cache. The events in the
transaction cache were added after commit_or_rollack and thereafter nothing
removed them.
An additional test case was added to detect this
condition.
mysql-test/extra/rpl_tests/rpl_loaddata.test:
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:
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:
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).
Diffstat (limited to 'sql/sql_load.cc')
-rw-r--r-- | sql/sql_load.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc index 71cc4c0507c..40962d82bc4 100644 --- a/sql/sql_load.cc +++ b/sql/sql_load.cc @@ -413,9 +413,6 @@ bool mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list, 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 *ex,TABLE_LIST *table_list, } } #endif /*!EMBEDDED_LIBRARY*/ + if (transactional_table) + ha_autocommit_or_rollback(thd,error); + error= -1; // Error on read goto err; } |