[MDEV-2518] LP:906322 - Wrong result with subquery containing DISTINCT and ORDER BY Created: 2011-12-19 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 | Priority: | Major |
| Reporter: | Timour Katchaounov (Inactive) | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
The following test case from subselect.test has recorded incorrect result: CREATE TABLE t1(pk INT PRIMARY KEY, a INT, INDEX idx(a));
---
--- SELECT * FROM t1 WHERE EXISTS (SELECT DISTINCT a FROM t2 WHERE t1.a < t2.a ORDER BY b);
---
--- The correct result is only one row, as shown by the same example without the CREATE TABLE t1(pk INT PRIMARY KEY, a INT);
---
--- SELECT * FROM t1 WHERE EXISTS (SELECT DISTINCT a FROM t2 WHERE t1.a < t2.a ORDER BY b);
---
--- In MariaDB 5.3/5.5 and MySQL 5.6 this bug is masked by a transformation that |
| Comments |
| Comment by Timour Katchaounov (Inactive) [ 2011-12-19 ] |
|
Re: Wrong result with subquery containing DISTINCT and ORDER BY 2647 Igor Babaev 2008-07-26 |
| Comment by Rasmus Johansson (Inactive) [ 2012-02-20 ] |
|
Launchpad bug id: 906322 |