LevelDB Storage Engine MS2 (MDEV-4201)

[MDEV-4304] LevelDB: Index-only scan by a field with utf8_bin collation returns garbage symbols Created: 2013-03-20  Updated: 2013-03-26  Resolved: 2013-03-26

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   

MySQL [test]> CREATE TABLE t1 (pk INT PRIMARY KEY, c1 CHAR(1), c2 CHAR(1), KEY(c1)) ENGINE=LevelDB CHARSET utf8 COLLATE utf8_bin;
Query OK, 0 rows affected (0.21 sec)
 
MySQL [test]> INSERT INTO t1 VALUES (1,'h','h');
Query OK, 1 row affected (0.00 sec)
 
MySQL [test]> SELECT * FROM t1;
+----+------+------+
| pk | c1   | c2   |
+----+------+------+
|  1 | h    | h    |
+----+------+------+
1 row in set (0.00 sec)
 
MySQL [test]> SELECT c1 FROM t1;
+------+
| c1   |
+------+
| h€?   |
+------+
1 row in set (0.00 sec)
 
MySQL [test]> EXPLAIN EXTENDED SELECT c1 FROM t1;
+----+-------------+-------+-------+---------------+------+---------+------+------+----------+-------------+
| id | select_type | table | type  | possible_keys | key  | key_len | ref  | rows | filtered | Extra       |
+----+-------------+-------+-------+---------------+------+---------+------+------+----------+-------------+
|  1 | SIMPLE      | t1    | index | NULL          | c1   | 4       | NULL | 1000 |   100.00 | Using index |
+----+-------------+-------+-------+---------------+------+---------+------+------+----------+-------------+
1 row in set, 1 warning (0.00 sec)

I'm not quite sure if index-only scans for utf8_bin are currently supported (the wiki page is unclear about it, it says " possibly support utf8_bin"), but I suppose in either case it should not return wrong results.

Test case (same as above, for copy-paste):

CREATE TABLE t1 (pk INT PRIMARY KEY, c1 CHAR(1), c2 CHAR(1), KEY(c1)) ENGINE=LevelDB CHARSET utf8 COLLATE utf8_bin;
INSERT INTO t1 VALUES (1,'h','h');
SELECT c1 FROM t1;

revision-id: psergey@askmonty.org-20130319094846-yze9xy3qeb5g6hrc
revno: 4610
branch-nick: mysql-5.6-leveldb



 Comments   
Comment by Sergei Petrunia [ 2013-03-25 ]

Yes, index_only scans are intended to be supported for utf8_bin collation. It seems, the code that unpacks the data back doesn't work correctly.

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