Bug #118839 | a query including the having subclause that returns NULL, return a wrong nonempty result. | ||
---|---|---|---|
Submitted: | 14 Aug 3:13 | Modified: | 18 Aug 14:25 |
Reporter: | Alice Alice | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S3 (Non-critical) |
Version: | 8.0.41 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[14 Aug 3:13]
Alice Alice
[18 Aug 11:30]
MySQL Verification Team
We're sorry, but the bug system is not the appropriate forum for asking help on using MySQL products. Your problem is not the result of a bug. For details on getting support for MySQL products see http://www.mysql.com/support/ You can also check our forums (free) at http://forums.mysql.com/ Thank you for your interest in MySQL.
[18 Aug 12:04]
Alice Alice
I insist it's a bug. because a query with "Having NULL", shall return an empty result set.
[18 Aug 14:25]
MySQL Verification Team
Apologies, I think you are actually right mysql> SELECT /*+ NO_INDEX_MERGE()*/v0.c0,(NOT (((DEFAULT(v0.c0))AND(t0.c0)))) FROM v0 NATURAL RIGHT JOIN t0 GROUP BY t0.c1, t0.c0, (CASE v0.c0 WHEN t0.c1 THEN (+ (CAST(t0.c1 AS CHAR))) WHEN 311759337 THEN false ELSE t0.c1 END ) HAVING (NOT (((DEFAULT(v0.c0))AND(t0.c0)))) ORDER BY v0.c0; +------+--------------------------------------+ | c0 | (NOT (((DEFAULT(v0.c0))AND(t0.c0)))) | +------+--------------------------------------+ | NULL | NULL | +------+--------------------------------------+ 1 row in set, 1 warning (0.001 sec) mysql> SELECT /*+ NO_INDEX_MERGE()*/v0.c0,(NOT (((DEFAULT(v0.c0))AND(t0.c0)))) FROM v0 NATURAL RIGHT JOIN t0 GROUP BY t0.c1, t0.c0, (CASE v0.c0 WHEN t0.c1 THEN (+ (CAST(t0.c1 AS CHAR))) WHEN 311759337 THEN false ELSE t0.c1 END ) HAVING null ORDER BY v0.c0; Empty set, 1 warning (0.001 sec) mysql> SELECT /*+ NO_INDEX_MERGE()*/v0.c0,(NOT (((DEFAULT(v0.c0))AND(t0.c0)))) FROM v0 NATURAL RIGHT JOIN t0 GROUP BY t0.c1, t0.c0, (CASE v0.c0 WHEN t0.c1 THEN (+ (CAST(t0.c1 AS CHAR))) WHEN 311759337 THEN false ELSE t0.c1 END ) HAVING NULL ORDER BY v0.c0; Empty set, 1 warning (0.001 sec) mysql> Thanks!