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

Pruning boundary for history partitions is wrong by 1 second

    XMLWordPrintable

    Details

      Description

      Reproduce

      -- source include/have_partition.inc
       
      set timestamp= unix_timestamp('2000-01-01 00:00:00');
      create or replace table t1 (x int) with system versioning
      partition by system_time interval 1 hour
      (partition p0 history, partition pn current);
       
      insert into t1 values (330);
      set timestamp= unix_timestamp('2000-01-01 00:10:00');
      update t1 set x= x + 1;
       
      --echo # Check how pruning boundaries work
      explain partitions select * from t1 for system_time as of '2000-01-01 00:59:58';
      explain partitions select * from t1 for system_time as of '2000-01-01 00:59:59';
       
      drop tables t1;
      

      Result

      Only pn selected.

      explain partitions select * from t1 for system_time as of '2000-01-01 00:59:59';
      id      select_type     table   partitions      type    possible_keys   key     key_len ref     rows    Extra
      1       SIMPLE  t1      pn      system  NULL    NULL    NULL    NULL    1
      

      Expected

      p0, pn selected.

      explain partitions select * from t1 for system_time as of '2000-01-01 00:59:59';
      id      select_type     table   partitions      type    possible_keys   key     key_len ref     rows    Extra
      1       SIMPLE  t1      p0, pn      system  NULL    NULL    NULL    NULL    1
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              midenok Aleksey Midenkov
              Reporter:
              midenok Aleksey Midenkov
              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.