mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
merge with 4.0
BitKeeper/etc/logging_ok: auto-union BitKeeper/deleted/.del-Makefile.am: Delete: Docs/Images/Makefile.am Build-tools/Bootstrap: Auto merged Docs/Makefile.am: Auto merged configure.in: Auto merged include/mysql.h: Auto merged innobase/dict/dict0dict.c: Auto merged libmysql/libmysql.c: Auto merged mysys/default.c: Auto merged scripts/mysqld_safe.sh: Auto merged sql/log.cc: Auto merged mysql-test/t/mix_innodb_myisam_binlog.test: Auto merged sql/mysqld.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_table.cc: Auto merged client/mysqldump.c: merge with 4.0 (This only reorders options) sql/ha_innodb.cc: merge with 4.0 (Keep original code) sql/time.cc: Note that part of this patch is done in my_time.c
This commit is contained in:
12
sql/log.cc
12
sql/log.cc
@ -1450,7 +1450,8 @@ COLLATION_CONNECTION=%u,COLLATION_DATABASE=%u,COLLATION_SERVER=%u",
|
||||
if (flush_io_cache(file) || sync_binlog(file))
|
||||
goto err;
|
||||
|
||||
if (opt_using_transactions && !my_b_tell(&thd->transaction.trans_log))
|
||||
if (opt_using_transactions &&
|
||||
!(thd->options & (OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
|
||||
{
|
||||
/*
|
||||
LOAD DATA INFILE in AUTOCOMMIT=1 mode writes to the binlog
|
||||
@ -1597,6 +1598,14 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, bool commit_or_rollback)
|
||||
*/
|
||||
{
|
||||
Query_log_event qinfo(thd, "BEGIN", 5, TRUE);
|
||||
/*
|
||||
Imagine this is rollback due to net timeout, after all statements of
|
||||
the transaction succeeded. Then we want a zero-error code in BEGIN.
|
||||
In other words, if there was a really serious error code it's already
|
||||
in the statement's events.
|
||||
This is safer than thd->clear_error() against kills at shutdown.
|
||||
*/
|
||||
qinfo.error_code= 0;
|
||||
/*
|
||||
Now this Query_log_event has artificial log_pos 0. It must be adjusted
|
||||
to reflect the real position in the log. Not doing it would confuse the
|
||||
@ -1630,6 +1639,7 @@ bool MYSQL_LOG::write(THD *thd, IO_CACHE *cache, bool commit_or_rollback)
|
||||
commit_or_rollback ? "COMMIT" : "ROLLBACK",
|
||||
commit_or_rollback ? 6 : 8,
|
||||
TRUE);
|
||||
qinfo.error_code= 0;
|
||||
qinfo.set_log_pos(this);
|
||||
if (qinfo.write(&log_file) || flush_io_cache(&log_file) ||
|
||||
sync_binlog(&log_file))
|
||||
|
Reference in New Issue
Block a user