Fixed a crash when formatting zero DOUBLE values using scientific notation.
Details
| Detail name | Value |
|---|---|
| Changelog Number | 30856 |
| Type | Bug |
| Status | Resolved |
| Affected Versions | Exasol 7.1.0, Exasol 8.0.0, Exasol 8.29.0, Exasol 2025.1.0, Exasol 2026.1.0 |
| Fix Versions | Exasol 2026.1.1, Exasol 2025.1.13 |
| Resolution Date | 2026-07-15 |
Description
A query that formats a DOUBLE value using TO_CHAR with a scientific notation format model may cause an internal server error or return wrong results.
This happens if all the following criteria are met and appear in the same query:
- The query contains TO_CHAR.
- The input value is of type DOUBLE.
- The format model uses scientific notation, for example '9EEEE'.
- The input value is 0.
Example
-- Expected: 1 row, values e.g. ("0E+00")
-- Observed: Internal server error
SELECT TO_CHAR(CAST(0 AS DOUBLE), '9EEEE');
CREATE TABLE A (A1 DOUBLE);
INSERT INTO A VALUES (0);
-- Expected: 1 row, values e.g. ("0E+00")
-- Observed: Internal server error
SELECT TO_CHAR(A1, '9EEEE') FROM A;
Workaround
Cast the DOUBLE value to an appropriate DECIMAL type before calling TO_CHAR, for example DECIMAL(36,18).
SELECT TO_CHAR(CAST(CAST(0 AS DOUBLE) AS DECIMAL(36,18)), '9EEEE'); CREATE TABLE A (A1 DOUBLE); INSERT INTO A VALUES (0); SELECT TO_CHAR(CAST(A1 AS DECIMAL(36,18)), '9EEEE') FROM A;
Fix
TO_CHAR now correctly formats DOUBLE zero values when scientific notation is requested. Queries return the expected formatted result instead of failing or producing incorrect output.