Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
12.3.1
-
None
-
None
-
ubuntu22.04
Description
Summary
SUM(b'1100') and SUM(DISTINCT b'1100') return different numeric results for the same BIT literal (e.g. 12 vs 9). DISTINCT should only remove duplicates, not change the values fed into the aggregate.
Impact
- Any query using SUM(DISTINCT ...) on BIT values or BIT literals that goes through the DISTINCT temp-table path may disagree with SUM(...) without DISTINCT.
Steps to reproduce
SELECT SUM(b'1100'), SUM(DISTINCT b'1100'); |
Actual result
- SUM(b'1100') = 12
- SUM(DISTINCT b'1100') = 9
- The two expressions are not equal.
Expected result
- SUM(b'1100') and SUM(DISTINCT b'1100') must match (both 12)