diff options
author | Sergei Golubchik <sergii@pisem.net> | 2010-03-15 12:51:23 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2010-03-15 12:51:23 +0100 |
commit | f09ca00e088b316441bb76e97ba097bc9f3da7d3 (patch) | |
tree | 1a557d74018ed9cd073b5aa960bd62421962e73d /sql/sql_base.cc | |
parent | 2ceaffc4672c62a772890da7761d11f13d3f5ee4 (diff) | |
parent | 71b3e46b0160936596195682a731703900fb4fff (diff) | |
download | mariadb-git-f09ca00e088b316441bb76e97ba097bc9f3da7d3.tar.gz |
merged
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index f5f1a700afa..79ca02ea994 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -1336,7 +1336,7 @@ void close_thread_tables(THD *thd) handled either before writing a query log event (inside binlog_query()) or when preparing a pending event. */ - thd->binlog_flush_pending_rows_event(TRUE); + (void)thd->binlog_flush_pending_rows_event(TRUE); mysql_unlock_tables(thd, thd->lock); thd->lock=0; } @@ -1556,7 +1556,11 @@ void close_temporary_tables(THD *thd) qinfo.db= db.ptr(); qinfo.db_len= db.length(); thd->variables.character_set_client= cs_save; - mysql_bin_log.write(&qinfo); + if (mysql_bin_log.write(&qinfo)) + { + push_warning(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, MYF(0), + "Failed to write the DROP statement for temporary tables to binary log"); + } thd->variables.pseudo_thread_id= save_pseudo_thread_id; } else @@ -4062,9 +4066,13 @@ retry: end = strxmov(strmov(query, "DELETE FROM `"), share->db.str,"`.`",share->table_name.str,"`", NullS); int errcode= query_error_code(thd, TRUE); - thd->binlog_query(THD::STMT_QUERY_TYPE, - query, (ulong)(end-query), - FALSE, FALSE, errcode); + if (thd->binlog_query(THD::STMT_QUERY_TYPE, + query, (ulong)(end-query), + FALSE, FALSE, errcode)) + { + my_free(query, MYF(0)); + goto err; + } my_free(query, MYF(0)); } else @@ -5714,7 +5722,8 @@ find_field_in_view(THD *thd, TABLE_LIST *table_list, if (!my_strcasecmp(system_charset_info, field_it.name(), name)) { // in PS use own arena or data will be freed after prepare - if (register_tree_change && thd->stmt_arena->is_stmt_prepare_or_first_sp_execute()) + if (register_tree_change && + thd->stmt_arena->is_stmt_prepare_or_first_stmt_execute()) arena= thd->activate_stmt_arena_if_needed(&backup); /* create_item() may, or may not create a new Item, depending on |