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

GTT: Forced-RBR fails with ER_BINLOG_STMT_MODE_AND_ROW_ENGINE on multi-UPDATE/DELETE

    XMLWordPrintable

Details

    Description

      --source include/master-slave.inc
      --source include/have_innodb.inc
      --source include/have_binlog_format_statement.inc
       
      CREATE TABLE t (c INT) ENGINE=InnoDB;
      CREATE GLOBAL TEMPORARY TABLE gtt (c INT) ENGINE=InnoDB ON COMMIT PRESERVE ROWS;
       
      INSERT INTO t VALUES (1);
      INSERT INTO gtt VALUES (1);
       
      UPDATE gtt SET c = 1;  # Works
      UPDATE t, gtt SET t.c = 2, gtt.c = 2;  # Fails
       
      --connection master
      TRUNCATE TABLE gtt;
      DROP TABLE t, gtt;
      --source include/rpl_end.inc
      

      Forced-RBR works correctly for a regular UPDATE, but fails for a multi-update where regular tables are involved. The same testcase passes when TT is used instead of GTT for the second table. Leads to:

      MDEV-35915-v13 CS 13.0.0 825771a5746c2522694cc2faa1b670023dd46182 (Optimized, Clang 21.1.3-20250923) Build 27/03/2026

      UPDATE gtt SET c = 1;
      UPDATE t, gtt SET t.c = 2, gtt.c = 2;
      main.test15 'stmt'                       [ fail ]
              Test ended at 2026-03-27 15:59:37
       
      CURRENT_TEST: main.test15
      mysqltest: At line 12: query 'UPDATE t, gtt SET t.c = 2, gtt.c = 2' failed: ER_BINLOG_STMT_MODE_AND_ROW_ENGINE (1665): Cannot execute statement: impossible to write to binary log since BINLOG_FORMAT = STATEMENT and at least one table uses a storage engine limited to row-based logging.
      

      Also applicable to multi-DELETE.
      Another similar disrepancy happens when using TRIGGERs or FUNCTIONs, ref MDEV-38646.

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.