Wrong result in maria-5.3-wl21 with ORDER BY + LIMIT
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
MariaDB |
Fix Released
|
Undecided
|
Igor Babaev |
Bug Description
The test case below returns 1 row with maria-5.3-wl21 and no rows with other trees and other plans. In particular, maria-5.3 produces exactly the same plan and the correct result. Maria-5.2 produces a slightly different plan with a correct result.
Test case:
--source include/
CREATE TABLE t2 ( f7 varchar(64), KEY (f7)) ENGINE=InnoDB;
INSERT IGNORE INTO t2 VALUES ('d'),(
CREATE TABLE t1 ( f10 int(11), f4 varchar(10), KEY (f10), KEY (f4)) ;
INSERT IGNORE INTO t1 VALUES ('4','e'
SET SESSION optimizer_
SELECT t1.f4 AS field1 FROM t2 JOIN t1 ON t2.f7 = t1.f4 WHERE t1.f10 IN ( 9 , 0 , 100 ) ORDER BY field1 LIMIT 1;
Explain:
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range f10,f4 f4 13 NULL 10 Using where
1 SIMPLE t2 ref f7 f7 67 test.t1.f4 1 Using where; Using index
Related branches
Changed in maria: | |
milestone: | none → 5.3 |
assignee: | nobody → Igor Babaev (igorb-seattle) |
Changed in maria: | |
status: | Confirmed → Fix Committed |
Changed in maria: | |
status: | Fix Committed → Fix Released |
Not reproducible with maria-5.1-wl21