mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
do not log the drop internal temporary tables into the binary log
mark killed partially completed updates with an error code in binlog stop replication if the master reports a possible partial/killed update test partially killed update mysql-test/r/rpl000001.result: updated result mysql-test/r/rpl000012.result: updated result mysql-test/t/rpl000001.test: test handing a killed partial update mysql-test/t/rpl000012.test: test temporary table replication more thoroughly sql/log_event.h: mark killed partially completed updates with an error code BitKeeper/etc/ignore: Added bdb/btree/btree_auto.c bdb/build_vxworks/db_int.h bdb/build_win32/db_int.h bdb/build_win32/include.tcl bdb/build_win32/libdb.rc bdb/db/crdel_auto.c bdb/db/db_auto.c bdb/dist/config.hin to the ignore list sql/slave.cc: stop replication if the master reports a possible partial/killed update sql/sql_base.cc: do not log the drop internal temporary tables into the binary log
This commit is contained in:
@@ -497,13 +497,14 @@ void close_temporary_tables(THD *thd)
|
||||
TABLE *table,*next;
|
||||
uint init_query_buf_size = 11, query_buf_size; // "drop table "
|
||||
char* query, *p;
|
||||
bool found_user_tables = 0;
|
||||
|
||||
LINT_INIT(p);
|
||||
query_buf_size = init_query_buf_size;
|
||||
|
||||
for (table=thd->temporary_tables ; table ; table=table->next)
|
||||
{
|
||||
query_buf_size += table->key_length;
|
||||
|
||||
}
|
||||
|
||||
if(query_buf_size == init_query_buf_size)
|
||||
@@ -519,15 +520,20 @@ void close_temporary_tables(THD *thd)
|
||||
{
|
||||
if(query) // we might be out of memory, but this is not fatal
|
||||
{
|
||||
p = strxmov(p,table->table_cache_key,".",
|
||||
// skip temporary tables not created directly by the user
|
||||
if(table->table_name[0] != '#')
|
||||
{
|
||||
p = strxmov(p,table->table_cache_key,".",
|
||||
table->table_name,",", NullS);
|
||||
// here we assume table_cache_key always starts
|
||||
// with \0 terminated db name
|
||||
// here we assume table_cache_key always starts
|
||||
// with \0 terminated db name
|
||||
found_user_tables = 1;
|
||||
}
|
||||
}
|
||||
next=table->next;
|
||||
close_temporary(table);
|
||||
}
|
||||
if (query && mysql_bin_log.is_open())
|
||||
if (query && found_user_tables && mysql_bin_log.is_open())
|
||||
{
|
||||
uint save_query_len = thd->query_length;
|
||||
*--p = 0;
|
||||
|
||||
Reference in New Issue
Block a user