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

MDEV-15621: ROW-binlog + INSERT: auto-creates an interval partition & logs the row, but not the implicit ADD PARTITION

    XMLWordPrintable

Details

    Description

      --source include/have_partition.inc
      --source include/have_innodb.inc
      --source include/have_binlog_format_row.inc
       
      # MDEV-15621: under ROW binlog format an INSERT that auto-creates an interval
      # partition logs the row but not the implicit ADD PARTITION
      # (sql/partition_info.cc:1058 sets no_write_to_binlog). Replaying that binlog
      # onto the table as first created hits HA_ERR_NO_PARTITION_FOUND and the row is
      # lost: the count below is 0 instead of 1.
       
      SET timestamp= UNIX_TIMESTAMP('2026-05-10 00:00:00');
      CREATE TABLE t1 (c DATETIME) ENGINE=InnoDB PARTITION BY RANGE COLUMNS (c) INTERVAL 1 DAY (PARTITION p0 VALUES LESS THAN ('2026-05-05'));
      RESET MASTER;  # Clear the binlog so only the INSERT is captured
      INSERT INTO t1 VALUES ('2026-05-08');
      --let $binlog=query_get_value(SHOW MASTER STATUS, File, 1)
       
      DROP TABLE t1;
      CREATE TABLE t1 (c DATETIME) ENGINE=InnoDB PARTITION BY RANGE COLUMNS (c) INTERVAL 1 DAY (PARTITION p0 VALUES LESS THAN ('2026-05-05'));
      --let $datadir= `SELECT @@datadir`
      --error 1  # Remark to see the binlog recovery failure (ERROR 1526 (HY000) at line 36: Table has no partition for value from column_list)
      --exec $MYSQL_BINLOG $datadir/$binlog 2>&1 | $MYSQL test
       
      SELECT COUNT(*) FROM t1;
      DROP TABLE t1;
      

      Leads to:

      bb-main-mdev-15621 CS 13.1.0 d11539dc5b41daa58342d901dd4a91576a048f16 (Debug, Clang 22.1.6-..475342) Build 29/05/2026

      2026-06-01 19:35:50 6 [ERROR]  BINLOG_BASE64_EVENT: Could not execute Write_rows_v1 event on table test.t1; Table has no partition for value from column_list, Error_code: 1526; handler error HA_ERR_NO_PARTITION_FOUND; the event's master log FIRST, end_log_pos 0, Internal MariaDB error code: 1526
      

      Or when remarking the binlog replay --error 1 handler, leads to:

      bb-main-mdev-15621 CS 13.1.0 d11539dc5b41daa58342d901dd4a91576a048f16 (Debug, Clang 22.1.6-..475342) Build 29/05/2026

      ERROR 1526 (HY000) at line 36: Table has no partition for value from column_list
      

      Attachments

        Issue Links

          Activity

            People

              ycp Yuchen Pei
              Roel Roel Van de Paar
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.