diff options
author | Alfranio Correia <alfranio.correia@sun.com> | 2010-08-03 12:52:02 +0100 |
---|---|---|
committer | Alfranio Correia <alfranio.correia@sun.com> | 2010-08-03 12:52:02 +0100 |
commit | 7909541953de43c7b7d16513c8d612cfe405af67 (patch) | |
tree | 5c763e77e56392f265e051abaf3f20c75a6bd865 /sql | |
parent | c65e99e00c93d662223601a3b38ef8df55009df7 (diff) | |
parent | f62e89fade7cda645de80e2996de69e7d980cbdd (diff) | |
download | mariadb-git-7909541953de43c7b7d16513c8d612cfe405af67.tar.gz |
auto-merge mysql-5.1-security (local) --> mysql-5.1-security
Diffstat (limited to 'sql')
-rw-r--r-- | sql/log.cc | 13 | ||||
-rw-r--r-- | sql/log.h | 3 | ||||
-rw-r--r-- | sql/sql_insert.cc | 11 |
3 files changed, 26 insertions, 1 deletions
diff --git a/sql/log.cc b/sql/log.cc index 614a07e6b63..3f41bf1c929 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -1628,6 +1628,19 @@ static int binlog_rollback(handlerton *hton, THD *thd, bool all) DBUG_RETURN(error); } +/** + Cleanup the cache. + + @param thd The client thread that wants to clean up the cache. +*/ +void MYSQL_BIN_LOG::reset_gathered_updates(THD *thd) +{ + binlog_trx_data *const trx_data= + (binlog_trx_data*) thd_get_ha_data(thd, binlog_hton); + + trx_data->reset(); +} + void MYSQL_BIN_LOG::set_write_error(THD *thd) { DBUG_ENTER("MYSQL_BIN_LOG::set_write_error"); diff --git a/sql/log.h b/sql/log.h index 8d3880d9171..8f1ed7ee90c 100644 --- a/sql/log.h +++ b/sql/log.h @@ -356,10 +356,11 @@ public: /* Use this to start writing a new log file */ void new_file(); + void reset_gathered_updates(THD *thd); bool write(Log_event* event_info); // binary log write bool write(THD *thd, IO_CACHE *cache, Log_event *commit_event, bool incident); - bool write_incident(THD *thd, bool lock); + bool write_incident(THD *thd, bool lock); int write_cache(IO_CACHE *cache, bool lock_log, bool flush_and_sync); void set_write_error(THD *thd); bool check_write_error(THD *thd); diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc index 35c24e7571e..83b1834da0b 100644 --- a/sql/sql_insert.cc +++ b/sql/sql_insert.cc @@ -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) |