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

Auto-partition fails when using maximum timestamp

    XMLWordPrintable

Details

    • Bug
    • Status: In Review (View Workflow)
    • Critical
    • Resolution: Unresolved
    • None
    • 13.1
    • Optimizer
    • None
    • Can result in unexpected behaviour
    • Q3/2026 Server Maintenance, Q3/2026 Server Development

    Description

      Maximum allowed value for timestamp variable is '2106-02-07 06:28:15'

      select unix_timestamp('2106-02-07 06:28:15'); or unix_timetamp('2106-02-07 11:58:15'); //4294967295

      set timestamp=4294967295;

      MariaDB [m8]> select NOW();
      +---------------------+
      | NOW()               |
      +---------------------+
      | 2106-02-07 11:58:15 |
      +---------------------+
      

      case1) Expected

      ------

      drop table t11;

      create table t11 (c timestamp) engine=innodb
      PARTITION BY RANGE COLUMNS (c)
      INTERVAL 1 day
      (
      PARTITION p0 VALUES LESS THAN ('2083-09-04 11:58:15')
      );

      insert into t11 values ('2026-04-20');
      ERROR 1499 (HY000): Too many partitions (including subpartitions) were defined

      Note:
      ------
      SELECT DATEDIFF('2106-02-07', '2083-09-04'); //8191
      Total no of partitions =8191+2 --Exceeds max allowed i.e 8192 , above error is expected

      case2)

      ---------------
      create table partition with ,anything greater then ('2083-09-04 11:58:15') , Fails to Auto-create new partition , instead throws error

      ex:
      SELECT DATEDIFF('2106-02-07', '2083-09-05'); //8190 +2 =Total 8192 partitions --should be allowed
      or
      SELECT DATEDIFF('2106-02-07', '2106-02-04'); //3 +2 =Total 5 partitions --should be allowed

      But it throws error:

      MariaDB [m8]> insert into t11 values ('2026-04-20');
      ERROR 1493 (HY000): VALUES LESS THAN value must be strictly increasing for each partition

      How to repeat:

      set timestamp=4294967295;
       
      drop table t11;
      create table t11 (c timestamp) engine=innodb
      PARTITION BY RANGE COLUMNS (c)
      INTERVAL 1 day
      (
        PARTITION p0 VALUES LESS THAN ('2083-09-05 11:58:15')
      );
       
      insert into t11 values ('2026-04-20');
      

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              mariadb-pavithrapandith Pavithra Pandith
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Time Tracking

                  Estimated:
                  Original Estimate - 1d 2h 23m Original Estimate - 1d 2h 23m
                  1d 2h 23m
                  Remaining:
                  Time Spent - 3h 8m Remaining Estimate - 1d 1h 16m
                  1d 1h 16m
                  Logged:
                  Time Spent - 3h 8m Remaining Estimate - 1d 1h 16m
                  3h 8m

                  Git Integration

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