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

Incorrect statistics and data for historical partitions for engine=Spider

    XMLWordPrintable

Details

    Description

      "information_schema.partitions" contains incorrect data about partitions for tables with engine=Spider (table_rows). Also request "select * from t_sp1 partition (p0)" returns data from current partition not from historical

      Test:

      --source include/have_innodb.inc
      --source include/have_partition.inc
       
      install soname 'ha_spider';
      set spider_same_server_link= on;
       
      eval create server s foreign data wrapper mysql options 
      (host '127.0.0.1', database 'test', user 'root', port $MASTER_MYPORT);
       
      CREATE TABLE t2(
         x INT,
         y INT,
         row_start TIMESTAMP(6),
         row_end TIMESTAMP(6)
      );
       
      create or replace table t_sp1 (x int,y int)
      engine=Spider COMMENT='wrapper "mysql", srv "s", table "t2"' 
      with system versioning partition by system_time (
          PARTITION p0 HISTORY,
          PARTITION pn CURRENT
      ); 
       
      insert into t_sp1 values (1,1),(2,2),(3,3),(4,4),(5,5);
       
      delete from t_sp1 where x=1;
       
      select * from t_sp1;
      select * from t_sp1 partition (p0);
       
      select partition_name, table_rows from information_schema.partitions where table_name = 't_sp1';
       
      drop tables t2, t_sp1;
      

      Actual result:

      select * from t_sp1;
      x	y
      2	2
      3	3
      4	4
      5	5
      select * from t_sp1 partition (p0);
      x	y
      2	2
      3	3
      4	4
      5	5
      select partition_name, table_rows from information_schema.partitions where table_name = 't_sp1';
      partition_name	table_rows
      p0	2
      pn	2
      

      Expected result:

      select * from t_sp1;
      x	y
      2	2
      3	3
      4	4
      5	5
      select * from t_sp1 partition (p0);
      x	y
      1	1
      select partition_name, table_rows from information_schema.partitions where table_name = 't_sp1';
      partition_name	table_rows
      p0	1
      pn	4
      

      Attachments

        Issue Links

          Activity

            People

              midenok Aleksey Midenkov
              lstartseva Lena Startseva
              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.