[MDEV-3713] LP:849739 - Wrong result with double GROUP BY and subquery Created: 2011-09-14 Updated: 2012-10-04 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: | Unassigned |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
The following query: SELECT * FROM t2 WHERE (a, b) IN ( returns only 1 row whereas it has to return the full set of 20 rows. Repeatable in maria-5.3 with both in_to_exists and materialization. Repeatable in mysql-5.5. See also previous GROUP BY bugs filed on LP. Explain: MariaDB [test]> explain SELECT * FROM t2 WHERE (a, b) IN ( SELECT a , b FROM t1 WHERE a IS NOT NULL GROUP BY a , b );
---
--- test case: DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2; optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,index_condition_pushdown=off,derived_merge=off,derived_with_keys=off,firstmatch=off,loosescan=off,materialization=on,in_to_exists=off,semijoin=off,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=off,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=off,semijoin_with_cache=off,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on bzr version-info |
| Comments |
| Comment by Elena Stepanova [ 2012-03-22 ] |
|
Re: Wrong result with double GROUP BY and subquery |
| Comment by Rasmus Johansson (Inactive) [ 2012-03-22 ] |
|
Launchpad bug id: 849739 |