1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-18 23:03:28 +03:00

read-only slave using statement replication should replicate tmp tables

Relates to MDEV-17863 DROP TEMPORARY TABLE creates a transaction in
binary log on read only server

Other things:
- Fixed that insert into normal_table select from tmp_table is
  replicated as row events if tmp_table doesn't exists on slave.
This commit is contained in:
Michael Widenius
2019-10-21 17:17:09 +03:00
parent 7def2877e3
commit 06d2e1d828
8 changed files with 135 additions and 7 deletions

View File

@ -5217,7 +5217,7 @@ bool mysql_create_table(THD *thd, TABLE_LIST *create_table,
err:
/* In RBR or readonly server we don't need to log CREATE TEMPORARY TABLE */
if (!result && create_info->tmp_table() &&
(thd->is_current_stmt_binlog_format_row() || opt_readonly))
(thd->is_current_stmt_binlog_format_row() || (opt_readonly && !thd->slave_thread)))
{
/* Note that table->s->table_creation_was_logged is not set! */
DBUG_RETURN(result);