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

MRR scan over partitioned InnoDB table produces "Out of memory" error

    XMLWordPrintable

Details

    Description

      Run this testcase

      --source include/have_partition.inc
      --source include/have_innodb.inc
       
      create table ten(a int);
      insert into ten values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
       
      create table one_k(a int);
      insert into one_k select A.a + B.a* 10 + C.a * 100 from ten A, ten B, ten C;
       
      create table t1 (
        ID bigint(20) NOT NULL AUTO_INCREMENT,
        part_id int,
        key_col int,
        col2 int,
        key(key_col),
        PRIMARY KEY (ID,part_id)
      ) ENGINE=InnoDB
       PARTITION BY RANGE (part_id)
      (PARTITION p1 VALUES LESS THAN (3) ENGINE = InnoDB,
       PARTITION p2 VALUES LESS THAN (7) ENGINE = InnoDB,
       PARTITION p3 VALUES LESS THAN (10) ENGINE = InnoDB
      );
       
      insert into t1 select
        A.a+10*B.a,
        A.a,
        B.a,
        123456
      from ten A, ten B;
       
      set optimizer_switch='mrr=on';
      explain
      select * from t1 force index (key_col) where key_col < 10;
      select * from t1 force index (key_col) where key_col < 10;
       
      drop table ten,one_k,t1;
      

      And it will fail with:

      mysqltest: At line 35: query 'select * from t1 force index (key_col) where key_col < 10' failed: 1041: Out of memory.
      

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              psergei Sergei Petrunia
              Votes:
              1 Vote for this issue
              Watchers:
              4 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.