Details
-
Type:
Technical task
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:
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
Gliffy Diagrams
Attachments
Activity
- All
- Comments
- Work Log
- History
- Activity
- Transitions
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.