[MDEV-22089] Group concat returns incorrect result when using DISTINCT and ORDER BY Created: 2020-03-31 Updated: 2023-11-10 |
|
| Status: | Stalled |
| Project: | MariaDB Server |
| Component/s: | Optimizer |
| Affects Version/s: | 10.2, 10.3, 10.4, 10.5 |
| Fix Version/s: | 10.4, 10.5 |
| Type: | Bug | Priority: | Major |
| Reporter: | Varun Gupta (Inactive) | Assignee: | Sergei Petrunia |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
Data set:
Now lets run the query without DISTINCT in GROUP_CONCAT
Now running the query with DISTINCT in GROUP_CONCAT
This is observed on top of the branch 10.5-mdev11563 (also expected to fail on all other versions) So the issue here is when Unique does not fit in memory for DISTINCT we flush the unique tree to the disk but in such cases we get incorrect result |
| Comments |
| Comment by Varun Gupta (Inactive) [ 2020-04-01 ] | |
|
Pushed a patch for this to the branch 10.5-mdev11563 | |
| Comment by Sergei Petrunia [ 2020-06-07 ] | |
|
The patch says:
but the parser accepts this? | |
| Comment by Sergei Petrunia [ 2020-06-07 ] | |
|
(JSON_ARRAYAGG is already broken by the patch for | |
| Comment by Varun Gupta (Inactive) [ 2020-06-12 ] | |
|
New patch based on 10.5 https://github.com/MariaDB/server/commit/5a6da66e6f081877b78c81656db9fd2a7e34598a |