Details
-
Technical task
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
It might well be related to MDEV-3965, but that task becomes somewhat difficult to read with the multiple scenarios, so I'll create a new one.
CREATE TABLE `t1` ( |
`d` date NOT NULL, |
`dt` datetime DEFAULT NULL, |
`ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
`t` time DEFAULT NULL, |
`y` year(4) DEFAULT NULL, |
PRIMARY KEY `d` (`d`) |
) ENGINE=LevelDB;
|
|
INSERT INTO t1 VALUES |
('2012-04-09','2012-04-09 05:27:00','2012-04-09 05:27:00','05:27:00','2012'); |
|
DROP TABLE t1; |
|
CREATE TABLE `t1` ( |
`d` date DEFAULT NULL, |
`dt` datetime NOT NULL, |
`ts` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, |
`t` time DEFAULT NULL, |
`y` year(4) DEFAULT NULL, |
PRIMARY KEY `dt` (`dt`) |
) ENGINE=LevelDB;
|
|
INSERT INTO t1 (d,dt,ts,t,y) VALUES |
('2012-04-09','2012-04-09 05:27:00','2012-04-09 05:27:00','05:27:00','2012'); |
|
SELECT dt FROM t1 ORDER BY dt LIMIT 3; |
|
Server hangs on the last statement, process list shows:
+----+------+-----------------+------+---------+------+---------------------+---------------------------------------+
|
| Id | User | Host | db | Command | Time | State | Info |
|
+----+------+-----------------+------+---------+------+---------------------+---------------------------------------+
|
| 3 | root | localhost:45920 | NULL | Query | 0 | init | show processlist |
|
| 1 | root | localhost | test | Query | 256 | Creating sort index | SELECT dt FROM t1 ORDER BY dt LIMIT 3 |
|
+----+------+-----------------+------+---------+------+---------------------+---------------------------------------+
|
Not sure if EXPLAIN is useful, but here it is anyway:
EXPLAIN EXTENDED
|
SELECT dt FROM t1 ORDER BY dt LIMIT 3;
|
id select_type table type possible_keys key key_len ref rows filtered Extra
|
1 SIMPLE t1 ALL NULL NULL NULL NULL 1000 100.00 Using filesort
|
Warnings:
|
Note 1003 /* select#1 */ select `test`.`t1`.`dt` AS `dt` from `test`.`t1` order by `test`.`t1`.`dt` limit 3
|
|