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

Aria or MyISAM table can no longer be opened after SYSTEM_TIME AUTO or INTERVAL partitioning adds partitions without its ROW_FORMAT

    XMLWordPrintable

Details

    Description

      --source include/have_partition.inc
       
      SET timestamp= UNIX_TIMESTAMP('2026-05-02 00:00:00');
      --error 0,ER_PARSE_ERROR
      CREATE TABLE t1 (a INT) ENGINE=Aria ROW_FORMAT=FIXED WITH SYSTEM VERSIONING PARTITION BY SYSTEM_TIME INTERVAL 1 HOUR AUTO PARTITIONS 3;
      if ($mysql_errno)
      {
        --skip Needs SYSTEM_TIME ... AUTO partitioning
      }
      INSERT INTO t1 VALUES (1),(2);
      SET timestamp= UNIX_TIMESTAMP('2026-05-02 05:00:00');
      # The DELETE adds history partitions
      DELETE FROM t1 WHERE a= 1;
      SELECT * FROM t1 FOR SYSTEM_TIME ALL;
      DROP TABLE t1;

      Leads to:

      CS 13.1.2 87e62ca17270e163a6d41b3fc8d6f4d440f1bb88 (Debug, Clang 22.1.8-20260622) Build 06/10/2026

      mysqltest: At line 13: query 'DELETE FROM t1 WHERE a= 1' failed: ER_GET_ERRNO (1030): Got error 174 "Fatal error during initialization of handler" from storage engine Aria

      The DELETE adds the history partitions p2 to p5. aria_chk -d shows Record format: Block for these, and Fixed length for p0, p1 and pn. After this, the table can no longer be opened, also after a restart. SELECT, INSERT and SHOW CREATE TABLE give the same error, and CHECK TABLE and REPAIR TABLE report it, with Corrupt. Only DROP TABLE works. Optimized builds give the same result.

      Aria with ROW_FORMAT=DYNAMIC also gives error 1030. MyISAM gives error 1030 with error 190 ("Incompatible key or row definition between the MariaDB .frm file and the information in the storage engine") when the table has ROW_FORMAT=DYNAMIC with only fixed-length columns, or ROW_FORMAT=FIXED with a VARCHAR column. InnoDB gives no error, but the new partitions get the default row format, and SHOW CREATE TABLE no longer shows the ROW_FORMAT of the table. The partitions that an INSERT adds with RANGE COLUMNS ... INTERVAL partitioning give the same results. An explicit ALTER TABLE ... ADD PARTITION keeps the row format. Aria with PAGE_CHECKSUM=0 gives error 174 as well, but there an explicit ADD PARTITION gives it too, as in MDEV-17968.

      From the code it seems that vers_create_partitions() in sql/partition_info.cc and range_interval_create_partitions() in sql/sql_partition_auto_interval.cc pass a new create_info without the row format to alter_add_partitions(). mysql_alter_table() in sql/sql_table.cc copies the row format of the table when the statement does not give one, and alter_add_partitions() does not go through it.

      Attachments

        Issue Links

          Activity

            People

              midenok Aleksey Midenkov
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - Not Specified
                  Not Specified
                  Logged:
                  Time Spent - 1h
                  1h

                  Git Integration

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