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
parent af134463
...@@ -1114,9 +1114,21 @@ bool MYSQL_LOG::write(Log_event* event_info) ...@@ -1114,9 +1114,21 @@ bool MYSQL_LOG::write(Log_event* event_info)
*/ */
if (file == &log_file) if (file == &log_file)
{
/*
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, error = ha_report_binlog_offset_and_commit(thd, log_file_name,
file->pos_in_file); file->pos_in_file);
}
should_rotate= (my_b_tell(file) >= (my_off_t) max_binlog_size); should_rotate= (my_b_tell(file) >= (my_off_t) max_binlog_size);
} }
...@@ -1159,7 +1171,7 @@ uint MYSQL_LOG::next_file_id() ...@@ -1159,7 +1171,7 @@ uint MYSQL_LOG::next_file_id()
NOTE NOTE
- We only come here if there is something in the cache. - 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. - 'cache' needs to be reinitialized after this functions returns.
IMPLEMENTATION IMPLEMENTATION
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment