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

Unexpected HA_ERR_TABLE_DEF_CHANGED upon CREATE..SELECT with SERIALIZABLE and unique blob

    XMLWordPrintable

Details

    • Can result in unexpected behaviour

    Description

      --source include/have_innodb.inc
       
      CREATE TABLE t (a INT PRIMARY KEY) ENGINE=InnoDB;
      INSERT INTO t VALUES (1),(2);
       
      SET SESSION TRANSACTION ISOLATION LEVEL SERIALIZABLE;
      SET innodb_snapshot_isolation = ON;
      CREATE TABLE t2 (b BLOB, UNIQUE(b)) ENGINE=InnoDB AS SELECT a AS b FROM t;
       
      DROP TABLE t, t2;
      

      10.6 8882f8fe6c5a87e2b367e260627af88ce9130d44

      mysqltest: At line 8: query 'CREATE TABLE t2 (b BLOB, UNIQUE(b)) ENGINE=InnoDB AS SELECT a AS b FROM t' failed: HA_ERR_TABLE_DEF_CHANGED (159): InnoDB: insufficient history for index 0
      

      2026-02-23 22:48:32 4 [ERROR] InnoDB: DROP TABLE `test`.`t2`: Record changed
      

      The error started happening after this commit in 10.6.23:

      commit 7fbbbc983f054a9c9c7f36ea8a9778ff3793a151
      Author: Marko Mäkelä
      Date:   Fri Jul 11 16:07:08 2025 +0300
       
          MDEV-36330: SERIALIZABLE read inconsistency
          
          At TRANSACTION ISOLATION LEVEL SERIALIZABLE, InnoDB would fail to flag
      

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              Marko Mäkelä Marko Mäkelä
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.