Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
AggregateCaseToFilterRule handles NULL values incorrectly. It converts
SELECT COUNT(CASE WHEN b THEN NULL ELSE 1 END) FROM t
to
SELECT COUNT(*) FILTER (WHERE b IS FALSE) FROM t
which fails to count rows where b is UNKNOWN, so it should convert to
SELECT COUNT(*) FILTER (WHERE b IS NOT TRUE) FROM t
Attachments
Issue Links
- links to