[MDEV-30005] Correlated subquery with aggregate function returns empty resultset Created: 2022-11-14 Updated: 2023-02-15 Resolved: 2023-02-15 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Manipulation - Subquery |
| Affects Version/s: | 10.4, 10.6.11, 10.5, 10.6, 10.7, 10.8, 10.9 |
| Fix Version/s: | 10.11.2, 11.0.0, 10.4.28, 10.5.19, 10.6.12, 10.7.8, 10.8.8, 10.9.5, 10.10.3 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Bartek Papierski | Assignee: | Rex Johnston |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | 11.0-sel, not-10.3, regression | ||
| Environment: |
Centos 7.9.2009, Aria engine, MariaDB-server 10.6.11 installed from package (http://yum.mariadb.org) |
||
| Attachments: |
|
||||||||
| Issue Links: |
|
||||||||
| Description |
|
Queries with correlated subqueries containing aggregate function return empty results. Steps to reproduce:
Expected result: The query above returns empty result set while the ones below return correct result: Use scalar query instead:
Use constant as id instead of reference to parent table:
Also casting sb.datetime to timestamp works ok:
The bug is not present in version 10.3. I experienced the bug after upgrading from 10.3 to 10.6, but I cannot confirm if it was also present in intermediate versions 10.4 and 10.5. |
| Comments |
| Comment by Alice Sherepa [ 2022-11-14 ] | |||||||||||||||||
|
Thank you for the report!
| |||||||||||||||||
| Comment by Rex Johnston [ 2023-01-31 ] | |||||||||||||||||
|
this appears to be fixed...
| |||||||||||||||||
| Comment by Sergei Petrunia [ 2023-02-03 ] | |||||||||||||||||
|
Need to find out which cset fixed it. Otherwise it could be that it's just this example stopped showing the issue. | |||||||||||||||||
| Comment by Rex Johnston [ 2023-02-15 ] | |||||||||||||||||
|
Fixed in |