summaryrefslogtreecommitdiff
path: root/sql/sql_load.cc
diff options
context:
space:
mode:
authorunknown <gbichot@dl145h.mysql.com>2007-02-26 20:35:28 +0100
committerunknown <gbichot@dl145h.mysql.com>2007-02-26 20:35:28 +0100
commit2e669d8e7b5944ad4a785ccd11424e060c5ce9bc (patch)
tree0129aa88d8b86e42ab9fbd202274ac2ee9c25fe9 /sql/sql_load.cc
parentc4780ac3b96749d6723495222021864891fd1503 (diff)
downloadmariadb-git-2e669d8e7b5944ad4a785ccd11424e060c5ce9bc.tar.gz
Fix for BUG#26050 "LOAD DATA INFILE breaks ACID"; the ok must be sent
to the client only after the binlog write and engine commit. No testcase for this bug, as to reproduce it, we need to "kill -9" mysqld, which we cannot do in the testsuite. But, I tested by hand. sql/sql_load.cc: D in ACID means that once the client got the ok from the server, the data is durable on disk. Implies that the ok must be sent after the binlog write and after the engine commit, not before.
Diffstat (limited to 'sql/sql_load.cc')
-rw-r--r--sql/sql_load.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_load.cc b/sql/sql_load.cc
index 5710f9c4c97..10124e5f5ff 100644
--- a/sql/sql_load.cc
+++ b/sql/sql_load.cc
@@ -353,7 +353,6 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
}
sprintf(name, ER(ER_LOAD_INFO), (ulong) info.records, (ulong) info.deleted,
(ulong) (info.records - info.copied), (ulong) thd->cuted_fields);
- send_ok(thd,info.copied+info.deleted,0L,name);
// on the slave thd->query is never initialized
if (!thd->slave_thread)
mysql_update_log.write(thd,thd->query,thd->query_length);
@@ -378,6 +377,9 @@ int mysql_load(THD *thd,sql_exchange *ex,TABLE_LIST *table_list,
#endif /*!EMBEDDED_LIBRARY*/
if (transactional_table)
error=ha_autocommit_or_rollback(thd,error);
+
+ /* ok to client sent only after binlog write and engine commit */
+ send_ok(thd, info.copied + info.deleted, 0L, name);
err:
if (thd->lock)
{