LevelDB storage engine (MDEV-3841)

[MDEV-4090] LevelDB: Wrong result (duplicate rows) on range access with secondary key and ORDER BY DESC Created: 2013-01-25  Updated: 2013-01-25  Resolved: 2013-01-25

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Technical task Priority: Major
Reporter: Elena Stepanova Assignee: Sergei Petrunia
Resolution: Fixed Votes: 0
Labels: leveldb

Issue Links:
Relates

 Description   

CREATE TABLE t1 (pk INT PRIMARY KEY, i INT, KEY(i)) ENGINE=LevelDB;
INSERT INTO t1 VALUES (1,10), (2,20);
SELECT i FROM t1 WHERE i NOT IN (8) ORDER BY i DESC;
i
20
20
10
10
EXPLAIN EXTENDED
SELECT i FROM t1 WHERE i NOT IN (8) ORDER BY i DESC;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
1	SIMPLE	t1	range	i	i	5	NULL	20	100.00	Using where; Using index
Warnings:
Note	1003	/* select#1 */ select `test`.`t1`.`i` AS `i` from `test`.`t1` where (`test`.`t1`.`i` <> 8) order by `test`.`t1`.`i` desc

Please note that the result is non-deterministic, here is the variation that I'm getting on the exact same test (now it's 3 rows, not 4):

CREATE TABLE t1 (pk INT PRIMARY KEY, i INT, KEY(i)) ENGINE=LevelDB;
INSERT INTO t1 VALUES (1,10), (2,20);
SELECT i FROM t1 WHERE i NOT IN (8) ORDER BY i DESC;
i
20
10
10
EXPLAIN EXTENDED
SELECT i FROM t1 WHERE i NOT IN (8) ORDER BY i DESC;
id	select_type	table	type	possible_keys	key	key_len	ref	rows	filtered	Extra
1	SIMPLE	t1	range	i	i	5	NULL	20	100.00	Using where; Using index
Warnings:
Note	1003	/* select#1 */ select `test`.`t1`.`i` AS `i` from `test`.`t1` where (`test`.`t1`.`i` <> 8) order by `test`.`t1`.`i` desc

Test case:

CREATE TABLE t1 (pk INT PRIMARY KEY, i INT, KEY(i)) ENGINE=LevelDB;
INSERT INTO t1 VALUES (1,10), (2,20);
SELECT i FROM t1 WHERE i NOT IN (8) ORDER BY i DESC;

revision-id: psergey@askmonty.org-20130125135708-w6flw90gj2voizou
revno: 4516
branch-nick: mysql-5.6-leveldb


Generated at Thu Feb 08 06:53:38 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.