summaryrefslogtreecommitdiff
path: root/sql/log.cc
diff options
context:
space:
mode:
authorunknown <guilhem@mysql.com>2003-05-10 14:52:22 -0400
committerunknown <guilhem@mysql.com>2003-05-10 14:52:22 -0400
commit6b14b0de14283d7566651c04340299f6508a4a6a (patch)
tree87aa1acd606bf82874e1c41e77e16e758cab737e /sql/log.cc
parentfb17658eb218a1b0a0965fd1acd0a8ec6a58a709 (diff)
downloadmariadb-git-6b14b0de14283d7566651c04340299f6508a4a6a.tar.gz
MySQL-classic did not pass the test suite rpl_rotate_logs.test anymore because a recent 1.1424.2.17 cset introduced an opt_using_transactions
which prevented binlogs to be rotated if transactions were not enabled. Fix for this. This bug did not affect releases. sql/log.cc: MySQL-classic did not pass the test suite rpl_rotate_logs.test anymore because a recent 1.1424.2.17 cset introduced an opt_using_transactions which prevented binlogs to be rotated if transactions were not enabled. Fix for this. This bug did not affect releases.
Diffstat (limited to 'sql/log.cc')
-rw-r--r--sql/log.cc32
1 files changed, 17 insertions, 15 deletions
diff --git a/sql/log.cc b/sql/log.cc
index f4c78b9c50d..79ee59eedf8 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -1133,24 +1133,26 @@ bool MYSQL_LOG::write(Log_event* event_info)
was a MyISAM event!
*/
- if (file == &log_file && opt_using_transactions
- && !my_b_tell(&thd->transaction.trans_log))
+ if (file == &log_file) // we are writing to the real log (disk)
{
- /*
- 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)
+ if (opt_using_transactions && !my_b_tell(&thd->transaction.trans_log))
{
- error = ha_report_binlog_offset_and_commit(thd, log_file_name,
- file->pos_in_file);
- called_handler_commit=1;
+ /*
+ 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);
+ called_handler_commit=1;
+ }
}
-
+ /* we wrote to the real log, check automatic rotation */
should_rotate= (my_b_tell(file) >= (my_off_t) max_binlog_size);
}