[MDEV-767] LP:1002139 - Unsorted result for query with ORDER BY if ref_or_null access is used Created: 2012-05-21  Updated: 2013-02-21  Resolved: 2013-02-20

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.2.15
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Igor Babaev Assignee: Oleksandr Byelkin
Resolution: Won't Fix Votes: 0
Labels: Launchpad

Attachments: XML File LPexportBug1002139.xml    

 Description   

The following sequence of commands produces unsorted result in MariaDB 5.2 though sorting is asked for:

CREATE TABLE t1 (
  a INT,
  c INT,
  UNIQUE KEY a_c (a,c),
  KEY (a)) engine=myisam;
 
INSERT INTO t1 VALUES (1,10), (2,NULL), (2,10);
ANALYZE TABLE t1;
EXPLAIN
SELECT c FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c;
SELECT c FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c;
 
MariaDB [test]> SELECT c FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c;
+------+
| c    |
+------+
|   10 |
| NULL |
+------+

In MariaDB the test case works correctly.

See also bug #13531865 from mysql-trunk code line.



 Comments   
Comment by Oleksandr Byelkin [ 2012-10-02 ]

Re: Unsorted result for query with ORDER BY if ref_or_null access is used
It is 5.2 only bug.

Comment by Rasmus Johansson (Inactive) [ 2012-10-02 ]

Launchpad bug id: 1002139

Comment by Oleksandr Byelkin [ 2013-02-20 ]

It is fixed in 5.3 and above.

Comment by Oleksandr Byelkin [ 2013-02-21 ]

Fix to above comment: It is not reproducable on 5.3, 5.5 and 10.0 (10.0-base).

Generated at Thu Feb 08 06:31:12 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.