Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-3841 LevelDB storage engine
  3. MDEV-4077

LevelDB: Wrong result (duplicate row) on select with range access by primary key

    XMLWordPrintable

Details

    • Technical task
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      Out of the following 4 SELECTs, first 3 return wrong result, and the last one is correct:

      CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=LevelDB;
      INSERT INTO t1 VALUES (10),(11);
       
      SELECT pk FROM t1 WHERE pk > 5 AND pk < 15;
      pk
      10
      10
      11
       
      EXPLAIN EXTENDED
      SELECT pk FROM t1 WHERE pk > 5 AND pk < 15;
      id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
      1	SIMPLE	t1	range	PRIMARY	PRIMARY	4	NULL	10	100.00	Using where; Using index
      Warnings:
      Note	1003	/* select#1 */ select `test`.`t1`.`pk` AS `pk` from `test`.`t1` where ((`test`.`t1`.`pk` > 5) and (`test`.`t1`.`pk` < 15))
       
      SELECT pk FROM t1 WHERE pk BETWEEN 5 AND 15;
      pk
      10
      10
      11
       
      EXPLAIN EXTENDED
      SELECT pk FROM t1 WHERE pk BETWEEN 5 AND 15;
      id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
      1	SIMPLE	t1	range	PRIMARY	PRIMARY	4	NULL	10	100.00	Using where; Using index
      Warnings:
      Note	1003	/* select#1 */ select `test`.`t1`.`pk` AS `pk` from `test`.`t1` where (`test`.`t1`.`pk` between 5 and 15)
       
      SELECT pk FROM t1 WHERE pk > 5;
      pk
      10
      10
      11
       
      EXPLAIN EXTENDED
      SELECT pk FROM t1 WHERE pk > 5;
      id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
      1	SIMPLE	t1	range	PRIMARY	PRIMARY	4	NULL	10	100.00	Using where; Using index
      Warnings:
      Note	1003	/* select#1 */ select `test`.`t1`.`pk` AS `pk` from `test`.`t1` where (`test`.`t1`.`pk` > 5)
       
      SELECT pk FROM t1 WHERE pk < 15;
      pk
      10
      11
       
      EXPLAIN EXTENDED
      SELECT pk FROM t1 WHERE pk < 15;
      id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
      1	SIMPLE	t1	range	PRIMARY	PRIMARY	4	NULL	10	100.00	Using where; Using index
      Warnings:
      Note	1003	/* select#1 */ select `test`.`t1`.`pk` AS `pk` from `test`.`t1` where (`test`.`t1`.`pk` < 15)

      Test case:

       
      CREATE TABLE t1 (pk INT PRIMARY KEY) ENGINE=LevelDB;
      INSERT INTO t1 VALUES (10),(11);
      SELECT pk FROM t1 WHERE pk > 5 AND pk < 15;
      SELECT pk FROM t1 WHERE pk BETWEEN 5 AND 15;
      SELECT pk FROM t1 WHERE pk > 5;
      SELECT pk FROM t1 WHERE pk < 15;

      revision-id: psergey@askmonty.org-20130123185233-7xokxc9ck9nosb2l
      revno: 4509
      branch-nick: mysql-5.6-leveldb

      Attachments

        Activity

          People

            psergei Sergei Petrunia
            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.