[MDEV-2662] LP:695442 - Wrong result in maria-5.3-wl21 with ORDER BY + LIMIT Created: 2010-12-29 Updated: 2015-02-02 Resolved: 2012-10-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Philip Stoev (Inactive) | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| 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/have_innodb.inc SET SESSION optimizer_switch='index_merge_sort_intersection=off'; Explain: id select_type table type possible_keys key key_len ref rows Extra |
| Comments |
| Comment by Philip Stoev (Inactive) [ 2010-12-29 ] | ||||||||||||||||||||||||||||||||
|
Re: Wrong result in maria-5.3-wl21 with ORDER BY + LIMIT | ||||||||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2010-12-29 ] | ||||||||||||||||||||||||||||||||
|
Re: Wrong result in maria-5.3-wl21 with ORDER BY + LIMIT MariaDB [test]> CREATE TABLE t2 ( f7 varchar(64), KEY (f7)); MariaDB [test]> INSERT IGNORE INTO t2 VALUES ('d'),('UALLN'),('d'),('z'),('r'),('YVAKV'),('d'),('TNGZK'),('e'),('xucupaxdyythsgiw'),('why'),('ttugkxucupaxdyyt'),('l'),('LHTKN'),('d'),('o'),('v'),('KGLCJ'),('your'); MariaDB [test]> CREATE TABLE t1 ( f10 int(11), f4 varchar(10), KEY (f10), KEY (f4)) ; MariaDB [test]> INSERT IGNORE INTO t1 VALUES ('4','e'),('891879424','l'),('-243400704','ectlyqupbk'),('1851981824','of'),('-1495203840','you'),('4','no'),('-1436942336','c'),('891420672','DQQYO'),('608698368','qergldqmec'),('1','x'); MariaDB [test]> MariaDB [test]> 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;
--------
-------- MariaDB [test]> EXPLAIN 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;
---
--- | ||||||||||||||||||||||||||||||||
| Comment by Igor Babaev [ 2010-12-29 ] | ||||||||||||||||||||||||||||||||
|
Re: Wrong result in maria-5.3-wl21 with ORDER BY + LIMIT | ||||||||||||||||||||||||||||||||
| Comment by Rasmus Johansson (Inactive) [ 2011-12-13 ] | ||||||||||||||||||||||||||||||||
|
Launchpad bug id: 695442 |