Bug #113318 | unnest scalar subquery using groupby produces wrong result | ||
---|---|---|---|
Submitted: | 4 Dec 2023 6:37 | Modified: | 1 Mar 20:38 |
Reporter: | chen jiang | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S2 (Serious) |
Version: | mysql-8.0.33, 8.0.35, 8.1.0, 8.2.0 | OS: | Any |
Assigned to: | CPU Architecture: | Any | |
Tags: | Scalar subquery, unnest, wrong result |
[4 Dec 2023 6:37]
chen jiang
[4 Dec 2023 7:08]
MySQL Verification Team
Hello chen jiang, Thank you for the report and test case. Verified as described. regards, Umesh
[1 Mar 20:38]
Jon Stephens
Documented fix as follows in the MySQL 8.4.0 changelog: A transform could be semantically invalid when the selected item in the subquery tested for NULL; the left outer join with a grouped derived table might in such cases produce NULLs whereas the original subquery might not. To prevent this from happening, we now bar such subqueries from being transformed. Closed.