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

Merge from 5.3

This commit is contained in:
unknown
2012-08-24 15:29:01 +02:00
45 changed files with 1217 additions and 467 deletions

View File

@ -3887,22 +3887,22 @@ static bool open_table_entry_fini(THD *thd, TABLE_SHARE *share, TABLE *entry)
entry->file->implicit_emptied= 0;
if (mysql_bin_log.is_open())
{
char *query, *end;
uint query_buf_size= 20 + share->db.length + share->table_name.length +1;
if ((query= (char*) my_malloc(query_buf_size,MYF(MY_WME))))
char query_buf[2*FN_REFLEN + 21];
String query(query_buf, sizeof(query_buf), system_charset_info);
query.length(0);
if (query.ptr())
{
/* this DELETE FROM is needed even with row-based binlogging */
end = strxmov(strmov(query, "DELETE FROM `"),
share->db.str,"`.`",share->table_name.str,"`", NullS);
query.append("DELETE FROM ");
append_identifier(thd, &query, share->db.str, share->db.length);
query.append(".");
append_identifier(thd, &query, share->table_name.str,
share->table_name.length);
int errcode= query_error_code(thd, TRUE);
if (thd->binlog_query(THD::STMT_QUERY_TYPE,
query, (ulong)(end-query),
query.ptr(), query.length(),
FALSE, FALSE, FALSE, errcode))
{
my_free(query);
return TRUE;
}
my_free(query);
}
else
{
@ -3912,7 +3912,7 @@ static bool open_table_entry_fini(THD *thd, TABLE_SHARE *share, TABLE *entry)
because of MYF(MY_WME) in my_malloc() above).
*/
sql_print_error("When opening HEAP table, could not allocate memory "
"to write 'DELETE FROM `%s`.`%s`' to the binary log",
"to write 'DELETE FROM %`s.%`s' to the binary log",
share->db.str, share->table_name.str);
delete entry->triggers;
return TRUE;