Skip to content
  • Daogang Qu's avatar
    15a641f6
    Wl#8872 Allow CREATE TEMPORARY/DROP TEMPORARY in transaction when GTID_MODE=ON in RBR - step1 · 15a641f6
    Daogang Qu authored
    Do not replicate CREATE TEMPORARY/DROP TEMPORARY when binlog_format=ROW/MIXED.
    Which requires the following four conditions:
    1. When @@session.binlog_format=ROW/MIXED, the server must not write
       CREATE TEMPORARY TABLE or DROP TEMPORARY TABLE to the binary log
       (this was already implemented). So that CREATE TEMPORARY TABLE
       and DROP TEMPORARY TABLE can not be replicated.
    2. SET @@session.binlog_format must be disallowed if session has
       open temporary table(s). Otherwise DROP TEMPORARY TABLE is
       written into binary log which disobeys the first condition
       in the following case:
         SET @@session.binlog_format=STATEMENT;
         CREATE TEMPORARY TABLE t1 (a INT);
         SET @@session.binlog_format=ROW;
         DROP TEMPORARY TABLE t1;
    3. SET @@global.binlog_format and SET @@persist.binlog_format must
       be disallowed if any replication channel has open temporary
       table(s). Otherwise DROP TEMPORARY TABLE is written into binary
       log on slave which disobeys the first condition in the
       following case:
         slave> SET @@global.binlog_format=STATEMENT;
         slave> START SLAVE;
         master> CREATE TEMPORARY TABLE t1(a INT);
         slave> [wait for t1 to replicate]
         slave> STOP SLAVE;
         slave> SET @@global.binlog_format=ROW / SET @@persist.binlog_format=ROW
         master> DROP TEMPORARY TABLE t1;
         slave> START SLAVE;
       Note: SET @@persist_only.binlog_format is not disallowed if any
       replication channel has open temporary table(s), since unlike
       PERSIST, PERSIST_ONLY does not modify the runtime global system
       variable value.
    4. SET @@global.binlog_format and SET @@persist.binlog_format must
       be disallowed if any replication channel applier is running,
       because SET @@global.binlog_format does not take effect when
       any replication channel applier is running. SET
       @@global.binlog_format takes effect on the channel until its
       applier is (re)starting. This is more restrictive than before.
       Note: SET @@persist_only.binlog_format is not disallowed if any
       replication channel applier is running, since unlike PERSIST,
       PERSIST_ONLY does not modify the runtime global system
       variable value.
    15a641f6
    Wl#8872 Allow CREATE TEMPORARY/DROP TEMPORARY in transaction when GTID_MODE=ON in RBR - step1
    Daogang Qu authored
    Do not replicate CREATE TEMPORARY/DROP TEMPORARY when binlog_format=ROW/MIXED.
    Which requires the following four conditions:
    1. When @@session.binlog_format=ROW/MIXED, the server must not write
       CREATE TEMPORARY TABLE or DROP TEMPORARY TABLE to the binary log
       (this was already implemented). So that CREATE TEMPORARY TABLE
       and DROP TEMPORARY TABLE can not be replicated.
    2. SET @@session.binlog_format must be disallowed if session has
       open temporary table(s). Otherwise DROP TEMPORARY TABLE is
       written into binary log which disobeys the first condition
       in the following case:
         SET @@session.binlog_format=STATEMENT;
         CREATE TEMPORARY TABLE t1 (a INT);
         SET @@session.binlog_format=ROW;
         DROP TEMPORARY TABLE t1;
    3. SET @@global.binlog_format and SET @@persist.binlog_format must
       be disallowed if any replication channel has open temporary
       table(s). Otherwise DROP TEMPORARY TABLE is written into binary
       log on slave which disobeys the first condition in the
       following case:
         slave> SET @@global.binlog_format=STATEMENT;
         slave> START SLAVE;
         master> CREATE TEMPORARY TABLE t1(a INT);
         slave> [wait for t1 to replicate]
         slave> STOP SLAVE;
         slave> SET @@global.binlog_format=ROW / SET @@persist.binlog_format=ROW
         master> DROP TEMPORARY TABLE t1;
         slave> START SLAVE;
       Note: SET @@persist_only.binlog_format is not disallowed if any
       replication channel has open temporary table(s), since unlike
       PERSIST, PERSIST_ONLY does not modify the runtime global system
       variable value.
    4. SET @@global.binlog_format and SET @@persist.binlog_format must
       be disallowed if any replication channel applier is running,
       because SET @@global.binlog_format does not take effect when
       any replication channel applier is running. SET
       @@global.binlog_format takes effect on the channel until its
       applier is (re)starting. This is more restrictive than before.
       Note: SET @@persist_only.binlog_format is not disallowed if any
       replication channel applier is running, since unlike PERSIST,
       PERSIST_ONLY does not modify the runtime global system
       variable value.
Loading