TO_DATE(TIMESTAMP, format) causes internal server error for non-constant format
Details
| Detail name | Value |
|---|---|
| Changelog Number | 20424 |
| Type | Bug |
| Status | Resolved |
| Affected Versions | Exasol 7.1.0, Exasol 8.0.0 |
| Fix Versions | Exasol 8.32.0 |
| Resolution Date | 2024-11-08 |
Description
The TO_DATE function causes an internal server error when called with two parameters and the first parameter is a TIMESTAMP/TIMESTAMP WITH LOCAL TIME ZONE and the second parameter is not a constant.
Example
CREATE TABLE t(ts TIMESTAMP, f VARCHAR(100)); INSERT INTO t VALUES (TIMESTAMP '2000-01-01 00:00:00.000', 'YYYY-MM-DD HH24:MI:SS.FF3'); SELECT TO_DATE(ts, f) FROM t;
Workaround
Use a constant format parameter or remove the format parameter since it’s not needed when converting from TIMESTAMP to DATE.
Fix
The function call now works correctly.