LevelDB Storage Engine MS2 (MDEV-4201)

[MDEV-4337] LevelDB: Inconsistent results comparing a char field with an int field Created: 2013-03-27  Updated: 2013-03-27  Resolved: 2013-03-27

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

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

Issue Links:
Relates

 Description   

MySQL [test]> create table t1 (c char(1), i int, primary key(c), key(i)) engine=LevelDB;
Query OK, 0 rows affected (0.15 sec)
 
MySQL [test]> insert into t1 values ('2',2),('6',6);
Query OK, 2 rows affected (0.01 sec)
Records: 2  Duplicates: 0  Warnings: 0
 
MySQL [test]> explain extended
    -> select * from t1 where c = i;
+----+-------------+-------+-------+---------------+------+---------+------+------+----------+--------------------------+
| id | select_type | table | type  | possible_keys | key  | key_len | ref  | rows | filtered | Extra                    |
+----+-------------+-------+-------+---------------+------+---------+------+------+----------+--------------------------+
|  1 | SIMPLE      | t1    | index | NULL          | i    | 5       | NULL | 1000 |   100.00 | Using where; Using index |
+----+-------------+-------+-------+---------------+------+---------+------+------+----------+--------------------------+
1 row in set, 1 warning (0.00 sec)
 
MySQL [test]> 
MySQL [test]> select * from t1 where c = i;
+---+------+
| c | i    |
+---+------+
| 6 |    6 |
+---+------+
1 row in set (0.00 sec)

Test case:

drop table if exists t1;
create table t1 (c char(1), i int, primary key(c), key(i)) engine=LevelDB;
insert into t1 values ('2',2),('6',6);
select * from t1 where c = i;

revision-id: psergey@askmonty.org-20130327131855-qxesm69dxnr3kcgy
revno: 4818
branch-nick: mysql-5.6-leveldb



 Comments   
Comment by Elena Stepanova [ 2013-03-27 ]

In other tests I also observe seemingly similar problems on comparing a char field with an int constant, although in the provided test case replacing = with in (2,6) didn't cause the discrepancy.
I won't file a bug about comparing to constants till this one is fixed since it's probably related.

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