diff options
author | sasha@mysql.sashanet.com <> | 2001-04-10 20:56:54 -0600 |
---|---|---|
committer | sasha@mysql.sashanet.com <> | 2001-04-10 20:56:54 -0600 |
commit | 102c1945eb20afcfc727ab9cec981f4b5204ed8c (patch) | |
tree | c052d8d91d91bacc775ebdfd8e299c23e4a6e100 /sql/sql_base.cc | |
parent | 54b9d367f9fd32e1c57b0abd53c6299fdafad81f (diff) | |
download | mariadb-git-102c1945eb20afcfc727ab9cec981f4b5204ed8c.tar.gz |
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
Diffstat (limited to 'sql/sql_base.cc')
-rw-r--r-- | sql/sql_base.cc | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sql/sql_base.cc b/sql/sql_base.cc index 38dfcbdaa7a..49c858b7a16 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -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; |