Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-3841 LevelDB storage engine
  3. MDEV-4086

LevelDB does not allow a query with multi-part pk and index and ORDER BY .. DEC

    Details

    • Type: Technical task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      mysql> select * from t1 where a = 1 and c = 1 and d = 1 order by e desc;
      ERROR 1031 (HY000): Table storage engine for 't1' doesn't have this option
      mysql> explain extended select * from t1 where a = 1 and c = 1 and d = 1 order by e desc;
      +----+-------------+-------+------+---------------+------+---------+-------------------+------+----------+-------------+
      | id | select_type | table | type | possible_keys | key  | key_len | ref               | rows | filtered | Extra       |
      +----+-------------+-------+------+---------------+------+---------+-------------------+------+----------+-------------+
      |  1 | SIMPLE      | t1    | ref  | PRIMARY,a     | a    | 13      | const,const,const |   10 |   100.00 | Using where |
      +----+-------------+-------+------+---------------+------+---------+-------------------+------+----------+-------------+
      1 row in set, 1 warning (0.00 sec)
      
      mysql> show warnings;
      +-------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | Level | Code | Message                                                                                                                                                                                                                                                         |
      +-------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | Note  | 1003 | /* select#1 */ select `db1`.`t1`.`a` AS `a`,`db1`.`t1`.`b` AS `b`,`db1`.`t1`.`c` AS `c`,`db1`.`t1`.`d` AS `d`,`db1`.`t1`.`e` AS `e` from `db1`.`t1` where ((`db1`.`t1`.`d` = 1) and (`db1`.`t1`.`c` = 1) and (`db1`.`t1`.`a` = 1)) order by `db1`.`t1`.`e` desc |
      +-------+------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      1 row in set (0.01 sec)
      
      
      mysql> show create table t1;
      +-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | Table | Create Table                                                                                                                                                                                                                                                                             |
      +-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      | t1    | CREATE TABLE `t1` (
        `a` int(11) NOT NULL DEFAULT '0',
        `b` int(11) NOT NULL DEFAULT '0',
        `c` int(11) NOT NULL DEFAULT '0',
        `d` int(11) DEFAULT NULL,
        `e` int(11) DEFAULT NULL,
        PRIMARY KEY (`a`,`b`,`c`),
        KEY `a` (`a`,`c`,`d`,`e`)
      ) ENGINE=LEVELDB DEFAULT CHARSET=latin1 |
      +-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
      1 row in set (0.00 sec)
      

      Test case:

      create table t1 (a int, b int, c int, d int, e int, primary key (a,b,c), key (a,c,d,e)) engine=LevelDB;
      insert into t1 values (1,1,1,1,1),(2,2,2,2,2);
      select * from t1 where a = 1 and c = 1 and d = 1 order by e desc;
      
      revision-id: psergey@askmonty.org-20130124165745-nm4yaxrsu8e4o2ll
      revno: 4511
      branch-nick: mysql-5.6-leveldb
      

        Gliffy Diagrams

          Attachments

            Activity

            There are no comments yet on this issue.

              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 - 1 hour, 30 minutes
                  1h 30m