Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-8573

Temporary Tables break replication in MIXED binlog_format

    Details

      Description

      We have run into a scenario where replication breaks on slaves when using MIXED replication and temporary tables.

      After a session is switched to ROW due to temporary tables existing, all subsequent events for the session should be in ROW. DDL statements affecting Temporary Tables in ROW format should not be logged.

      Test Case

      SET @@global.binlog_format=MIXED;
      connect;
      create temporary table ptest1(i int); // This switched session to ROW until temporary table is removed
      select current_user(); // This switches session MIXED to ROW, and since a temp table exists, all other statements are logged as ROW.
      create temporary table ptest2(i int);
      create index i on ptest2(i);

      Expected behavior
      Create index on temporary table is not logged to binlog, since the session should follow ROW logging rules.

      Actual behavior
      On mariadb 10.0.20, create index is logged and breaks replication on slave
      On mysql 5.6.26 and 5.6.14, create index is not logged.

      Attaching output from both mysql 5.6 and mariadb 10.0.20 attached, and the binlog from mariadb test.

        Attachments

          Activity

            People

            • Assignee:
              sujatha.sivakumar Sujatha Sivakumar
              Reporter:
              dtest Derek Downey
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: