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

GTT: ER_BINLOG_STMT_MODE_AND_ROW_ENGINE upon INSERT

    XMLWordPrintable

Details

    • Can result in unexpected behaviour
    • Q1/2026 Server Development

    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;
       
      CREATE TRIGGER tr AFTER INSERT ON t FOR EACH ROW INSERT INTO gtt VALUES (NEW.c);
       
      # SBR Incompatibility
      # Expected: Successful INSERT (forcing ROW-based for the GTT part).
      # Actual: Fails with ER_BINLOG_STMT_MODE_AND_ROW_ENGINE (1665).
      INSERT INTO t VALUES (1);
       
      --connection master
      TRUNCATE TABLE gtt;
      DROP TABLE t, gtt;
      --source include/rpl_end.inc
      

      Leads to:

      MDEV-35915-v11 CS 12.2.0 8934bac9ea05b79f7a5109d9e980cb939a24d4e3 (Debug, Clang 21.1.3-20250923) Build 19/01/2026

      mysqltest: At line 13: query 'INSERT INTO t VALUES (1)' 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.
      

      An operation that should be safe in SBR (INSERT INTO t1) crashes because the dependency (the GTT inside the trigger) forces a requirement (ROW format) that the cannot be satisfied.

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              3 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.