1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

Bug#40013 mixed replication: row based format could lead to stale tmp tables on the

slave.

In mixed mode, if we create a temporary table and do some update which switch to ROW format,
the format will keep in ROW format until the session ends or the table is dropped explicitly. 
When the session ends, the temp table is dropped automaticly at cleanup time.
but it checks only current binlog format and so skip insertion of DROP TABLE instructions into binlog.
So the temp table can't be dropped correctly at slave.

Our solution is that when closing temp tables at cleanup time we check both binlog format and binlog mode,
and we could write DROP TABLE instructions into binlog if current binlog format is ROW but in MIX mode.
This commit is contained in:
Leonard Zhou
2009-02-23 11:26:38 +08:00
parent 2515ce79e8
commit 8a6084816a
3 changed files with 77 additions and 1 deletions

View File

@ -1440,7 +1440,8 @@ void close_temporary_tables(THD *thd)
if (!thd->temporary_tables)
return;
if (!mysql_bin_log.is_open() || thd->current_stmt_binlog_row_based)
if (!mysql_bin_log.is_open() ||
(thd->current_stmt_binlog_row_based && thd->variables.binlog_format == BINLOG_FORMAT_ROW))
{
TABLE *tmp_next;
for (table= thd->temporary_tables; table; table= tmp_next)