1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Backport Bug#37148 to 5.1

This commit is contained in:
He Zhenxing
2010-01-24 15:03:23 +08:00
parent a365016f8b
commit 6bf8c119fe
28 changed files with 472 additions and 159 deletions

View File

@ -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;
}
@ -1550,7 +1550,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
@ -4031,9 +4035,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