[MDEV-3629] LP:879860 - Wrong result with correlated query in select list + aggregate Created: 2011-10-22 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: | Philip Stoev (Inactive) | Assignee: | Igor Babaev |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
The following query: SELECT ( SELECT MIN( t1.a ) FROM t1, t2 WHERE t2.a = t3.t1 ) FROM t3; returns
even though the correct result should be
as there are no rows for which t2.a = t3.t1 is true explain:
repeatable in maria-5.3, maria-5.2, mysql-5.5 test case: CREATE TABLE t1 ( a int NOT NULL, PRIMARY KEY (a)) engine=myisam; CREATE TABLE t2 ( a int NOT NULL ) engine=myisam; CREATE TABLE t3 ( a int NOT NULL , t1 int) engine=myisam; SELECT ( SELECT MIN( t1.a ) FROM t1, t2 WHERE t2.a = t3.t1 ) FROM t3; |
| Comments |
| Comment by Rasmus Johansson (Inactive) [ 2012-02-20 ] |
|
Launchpad bug id: 879860 |