1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

BUG#55625 RBR breaks on failing 'CREATE TABLE'

A CREATE...SELECT that fails is written to the binary log if a non-transactional
statement is updated. If the logging format is ROW, the CREATE statement and the
changes are written to the binary log as distinct events and by consequence the
created table is not rolled back in the slave.

In this patch, we opted to let the slave goes out of sync by not writting to the
binary log the CREATE statement. We do this by simply reseting the binary log's
cache.
This commit is contained in:
Alfranio Correia
2010-08-02 20:48:56 +01:00
parent 2aee4d8ddd
commit 1feee134fd
5 changed files with 102 additions and 2 deletions

View File

@ -3873,6 +3873,17 @@ void select_create::abort()
if (table)
{
if (thd->lex->sql_command == SQLCOM_CREATE_TABLE &&
thd->current_stmt_binlog_row_based &&
!(thd->lex->create_info.options & HA_LEX_CREATE_TMP_TABLE) &&
mysql_bin_log.is_open())
{
/*
This should be removed after BUG#47899.
*/
mysql_bin_log.reset_gathered_updates(thd);
}
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
table->file->extra(HA_EXTRA_WRITE_CANNOT_REPLACE);
if (!create_info->table_existed)