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

Auto-create: ODKU does not cause partition creation

    XMLWordPrintable

Details

    Description

      MDEV-17554 description says that INSERT... ON DUPLICATE KEY UPDATE should trigger auto-creation. It doesn't appear to be the case.

      Here is a test case from versioning/partition.test, almost literal (I just added 1 second to the second timestamp, to avoid boundary issues)

      --source include/have_partition.inc
       
      set timestamp= unix_timestamp('2000-01-01 00:00:00');
      create or replace table t1 (x int primary key) with system versioning
      partition by system_time interval 1 hour auto;
      insert into t1 values (1);
      set timestamp= unix_timestamp('2000-01-01 01:00:01');
      insert into t1 values (1) on duplicate key update x= x + 1;
      show create table t1;
      

      And just like in the test result file, the partition is not created:

      bb-10.6-midenok-MDEV-17554 b96b96f9f

      show create table t1;
      Table	Create Table
      t1	CREATE TABLE `t1` (
        `x` int(11) NOT NULL,
        PRIMARY KEY (`x`)
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1 WITH SYSTEM VERSIONING
       PARTITION BY SYSTEM_TIME INTERVAL 1 HOUR STARTS TIMESTAMP'2000-01-01 00:00:00' AUTO
      PARTITIONS 2
      

      select *, row_end from t1 for system_time all;
      x	row_end
      1	2000-01-01 01:00:01.000000
      2	2038-01-19 05:14:07.999999
      

      I haven't found any other MTR tests for it. If it is not supposed to auto-create partition after all, then please update the description in MDEV-17554 and add a comment to the test. If it's meant to work, please add somewhat more comprehensive tests for it.

      Attachments

        Issue Links

          Activity

            People

              midenok Aleksey Midenkov
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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