MUL set function gives wrong results for DECIMAL with non-zero scale
Details
| Detail name | Value |
|---|---|
| Changelog Number | 29180 |
| Type | Bug |
| Status | Resolved |
| Affected Versions | Exasol 7.1.0, Exasol 8.0.0, Exasol 8.1.0, Exasol 2025.1.0, Exasol 2025.2.0 |
| Fix Versions | Exasol 2026.1.0, Exasol 2025.2.1, Exasol 2025.1.11 |
| Resolution Date | 2026-03-20 |
Description
The SQL set function MUL evaluates the product of its argument for all the rows in the group.
For DECIMAL types with a non-zero scale, the result is wrong.
Example
-- Setup CREATE TABLE a (a1 DECIMAL(9, 1)); INSERT INTO a VALUES (1.1), (2.1); -- Expected: 1 row, values (2, 2.31) -- Observed: 1 row, values (2, 231) SELECT COUNT(*), MUL(a1) FROM a;
Workaround
Cast the argument to MUL as DOUBLE:
-- Expected/Observed: 1 row, values (2, 2.31) SELECT COUNT(*), MUL(CAST(a1 AS DOUBLE)) FROM a;
Fix
The MUL set function works as intended.