mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
Merge mysql.com:/home/bkroot/mysql-5.1-new
into mysql.com:/home/bk/w3023-mysql-5.1-new mysql-test/extra/binlog_tests/ctype_cp932.test: Auto merged mysql-test/r/binlog_row_blackhole.result: Auto merged mysql-test/r/binlog_stm_ctype_cp932.result: Auto merged sql/handler.cc: Auto merged sql/handler.h: Auto merged sql/lock.cc: Auto merged sql/log.cc: Auto merged sql/log.h: Auto merged sql/log_event.h: Auto merged sql/mysql_priv.h: Auto merged sql/opt_range.cc: Auto merged sql/parse_file.cc: Auto merged sql/slave.cc: Auto merged sql/sql_acl.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_class.cc: Auto merged sql/sql_class.h: Auto merged sql/sql_insert.cc: Auto merged sql/sql_load.cc: Auto merged sql/sql_table.cc: Auto merged sql/sql_update.cc: Auto merged sql/table.h: Auto merged sql/log_event.cc: Merge with mysql-5.1-new
This commit is contained in:
@@ -1033,21 +1033,18 @@ void close_thread_tables(THD *thd, bool lock_in_use, bool skip_derived)
|
||||
/* Fallthrough */
|
||||
}
|
||||
|
||||
/*
|
||||
For RBR: before calling close_thread_tables(), storage engines
|
||||
should autocommit. Hence if there is a a pending event, it belongs
|
||||
to a non-transactional engine, which writes directly to the table,
|
||||
and should therefore be flushed before unlocking and closing the
|
||||
tables. The test above for locked tables will not be triggered
|
||||
since RBR locks and unlocks tables on a per-event basis.
|
||||
|
||||
TODO (WL#3023): Change the semantics so that RBR does not lock and
|
||||
unlock tables on a per-event basis.
|
||||
*/
|
||||
thd->binlog_flush_pending_rows_event(true);
|
||||
|
||||
if (thd->lock)
|
||||
{
|
||||
/*
|
||||
For RBR we flush the pending event just before we unlock all the
|
||||
tables. This means that we are at the end of a topmost
|
||||
statement, so we ensure that the STMT_END_F flag is set on the
|
||||
pending event. For statements that are *inside* stored
|
||||
functions, the pending event will not be flushed: that will be
|
||||
handled either before writing a query log event (inside
|
||||
binlog_query()) or when preparing a pending event.
|
||||
*/
|
||||
thd->binlog_flush_pending_rows_event(true);
|
||||
mysql_unlock_tables(thd, thd->lock);
|
||||
thd->lock=0;
|
||||
}
|
||||
@@ -1059,7 +1056,8 @@ void close_thread_tables(THD *thd, bool lock_in_use, bool skip_derived)
|
||||
saves some work in 2pc too)
|
||||
see also sql_parse.cc - dispatch_command()
|
||||
*/
|
||||
bzero(&thd->transaction.stmt, sizeof(thd->transaction.stmt));
|
||||
if (!(thd->state_flags & Open_tables_state::BACKUPS_AVAIL))
|
||||
bzero(&thd->transaction.stmt, sizeof(thd->transaction.stmt));
|
||||
if (!thd->active_transaction())
|
||||
thd->transaction.xid_state.xid.null();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user