summaryrefslogtreecommitdiff
path: root/sql/log.cc
diff options
context:
space:
mode:
authorunknown <heikki@hundin.mysql.fi>2002-12-11 21:24:28 +0200
committerunknown <heikki@hundin.mysql.fi>2002-12-11 21:24:28 +0200
commitb870cfa5952056bbde9d0a92c63d87ade129d27f (patch)
treeaee202560d16959e599619441ae3d9a618f91b14 /sql/log.cc
parent7c625dc5bccdb9878a1b0f42ff41578fd94da5cb (diff)
downloadmariadb-git-b870cfa5952056bbde9d0a92c63d87ade129d27f.tar.gz
log.cc:
We must not commit inside InnoDB when LOAD DATA INFILE just writes a block to the binlog; only commit if the log event type is QUERY_EVENT or EXECUTE_LOAD_EVENT sql/log.cc: We must not commit inside InnoDB when LOAD DATA INFILE just writes a block to the binlog; only commit if the log event type is QUERY_EVENT or EXECUTE_LOAD_EVENT
Diffstat (limited to 'sql/log.cc')
-rw-r--r--sql/log.cc16
1 files changed, 14 insertions, 2 deletions
diff --git a/sql/log.cc b/sql/log.cc
index 56019a76b22..21c88cc1616 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1115,8 +1115,20 @@ bool MYSQL_LOG::write(Log_event* event_info)
if (file == &log_file)
{
- error = ha_report_binlog_offset_and_commit(thd, log_file_name,
+ /*
+ LOAD DATA INFILE in AUTOCOMMIT=1 mode writes to the binlog
+ chunks also before it is successfully completed. We only report
+ the binlog write and do the commit inside the transactional table
+ handler if the log event type is appropriate.
+ */
+
+ if (event_info->get_type_code() == QUERY_EVENT
+ || event_info->get_type_code() == EXEC_LOAD_EVENT)
+ {
+ error = ha_report_binlog_offset_and_commit(thd, log_file_name,
file->pos_in_file);
+ }
+
should_rotate= (my_b_tell(file) >= (my_off_t) max_binlog_size);
}
@@ -1159,7 +1171,7 @@ uint MYSQL_LOG::next_file_id()
NOTE
- We only come here if there is something in the cache.
- - The thing in the cache is always a complete transcation
+ - The thing in the cache is always a complete transaction
- 'cache' needs to be reinitialized after this functions returns.
IMPLEMENTATION