Details
-
New Feature
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
Description
In some context, temporary tables on the master and slave can become inconsistent.
Example: If a temporary table is updated with the value of a nondeterministic function like UUID(), the change is never sent to the slave.
In some other context, while using MIXED mode, all changes will be logged in ROW mode while the user has any active temporary tables even if the temporary tables is not used in the query. This depends on in which format some previous independent commands where logged.
There are many other pitfalls with logging temporary table to the slave, which is why we are changing that, by default, temporary tables are only created on the slave if the master is using binlog_format=STATEMENT.
The new deterministic rules for logging of temporary tables are:
- STATEMENT binlog format is used. If it is binlogged, 1 is stored in TABLE_SHARE->table_creation_was_logged. The user can change this behavior by setting create_temporary_table_binlog_formats to MIXED,STATEMENT in which case the create is logged in statement format also in MIXED mode (as before).
- Changes to temporary tables are only binlogged if and only if the CREATE was logged. The logging happens under STATEMENT or MIXED. If binlog_format=ROW, temporary table changes are not binlogged. A temporary table that are changed under ROW are marked as 'not up to date in binlog' and no future row changes are logged. Any usage of this temporary table will force row logging of other tables in any future statements using the temporary table to be row logged.
- DROP TEMPORARY is binlogged only if the CREATE was binlogged.
Attachments
Issue Links
- causes
-
MDEV-36488 create_temporary_table_binlog_formats treats numeric values differently
-
- Closed
-
-
MDEV-36563 Assertion `!mysql_bin_log.is_open()' failed in THD::mark_tmp_table_as_free_for_reuse upon REPAIR
-
- Closed
-
-
MDEV-36566 SELECT create_temporary_table_binlog_formats should show exactly what it is SET to
-
- Closed
-
-
MDEV-36735 rpl.rpl_drop_temp Result Content Mismatch Failure (12.0)
-
- Closed
-
-
MDEV-36898 Assertion failure upon using temporary sequence with SBR
-
- Open
-
-
MDEV-36980 Assertion `thd->mdl_context.is_lock_owner()...fails in close_thread_table, SIGSEGV in mysql_create_like_table
-
- Closed
-
-
MDEV-37348 Logged CREATE TEMPORARY TABLE LIKE from unlogged table fails
-
- Closed
-
-
MDEV-37719 use-after-free on logged CREATE OR REPLACE TEMPORARY TABLE LIKE not-logged-table
-
- Stalled
-
-
MDEV-37785 Assertion `!mysql_bin_log.is_open()' failed in THD::mark_tmp_table_as_free_for_reuse on ALTER TABLE
-
- Confirmed
-
-
MDEV-37882 Assertion failed on Multi-update of unlogged temporary table
-
- Confirmed
-
- relates to
-
MDEV-17472 Improving replication reliability with MIXED binlog_format and temporary tables
-
- Open
-
-
MDEV-37108 Assertion `!mysql_bin_log.is_open()' failed in THD::mark_tmp_table_as_free_for_reuse on DELETE
-
- Closed
-
-
MDEV-37785 Assertion `!mysql_bin_log.is_open()' failed in THD::mark_tmp_table_as_free_for_reuse on ALTER TABLE
-
- Confirmed
-
-
MDEV-16909 RBR aborts with ER_NO_SUCH_TABLE upon RENAME on temporary table
-
- Closed
-
-
MDEV-21442 Changes to temporary tables are no longer logged
-
- Stalled
-
-
MDEV-25292 Atomic CREATE OR REPLACE TABLE
-
- Stalled
-
-
MDEV-36265 Unique error for changing Domain ID with open temporary tables
-
- Closed
-