| Bug #114638 | ROLLUP misses a summary NULL | ||
|---|---|---|---|
| Submitted: | 12 Apr 2024 16:33 | Modified: | 5 Aug 2024 21:54 |
| Reporter: | Guilhem Bichot | Email Updates: | |
| Status: | Closed | Impact on me: | |
| Category: | MySQL Server: DML | Severity: | S4 (Feature request) |
| Version: | 8.0 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
[12 Apr 2024 16:33]
Guilhem Bichot
[15 Apr 2024 10:11]
MySQL Verification Team
Salut Guilhem, Thank you for your bug report. We have checked with the SQL standard and you are correct. This is a verified for 8.0 and above. Thanks.
[5 Aug 2024 21:54]
Jon Stephens
Documented fix as follows in the MySQL 9.1.0 changelog:
A ROLLUP query did not take account a summary NULL. Consider the
following statements:
CREATE TABLE t(a INT);
SELECT a, COUNT(*) FROM t GROUP BY a WITH ROLLUP;
According to the SQL standard, the SELECT statement should be
equivalent to a UNION query which produces the result (0, NULL)
because, even with an empty result set, ROLLUP should give us a
single grouping row with NULL entries for all GROUP BY
expressions as well as a grand total for any aggregates, in this
0 for COUNT(*), but MySQL returned an empty set instead.
Now we return the grouping row in such cases.
Closed.
(Bonjour Guilhem et merci beaucoup pour l'explication très claire du problème!)
[6 Aug 2024 9:58]
MySQL Verification Team
Thank you, Jon.
