Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-4201 LevelDB Storage Engine MS2
  3. MDEV-4337

LevelDB: Inconsistent results comparing a char field with an int field

    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

            Hide
            elenst Elena Stepanova added a comment -

            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.

            Show
            elenst Elena Stepanova added a comment - 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.

              People

              • Assignee:
                psergey Sergei Petrunia
                Reporter:
                elenst Elena Stepanova
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 15 minutes
                  15m