You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: TS to TIMESTAMP conversion changes the absolute instant with session time zone #27637
Converting an internal transaction timestamp (T_TS) to SQL TIMESTAMP through ts_to_time or CAST(TS AS TIMESTAMP) changed the underlying instant when the session time zone was not UTC.
Root cause
The conversion formatted the HLC physical Unix-nanosecond value as a UTC wall-clock string and reparsed that string in the session time zone. The parse therefore applied the session offset a second time. The same implementation also allocated and parsed a string for every row.
Expected behavior
The HLC physical component is already an absolute instant. Both conversion entry points must preserve its epoch value regardless of session time zone. The HLC logical component only orders events at the same physical instant and has no SQL TIMESTAMP representation.
Reproduction
Using a table-function metadata scan that exposes create_ts as T_TS:
Set the session time zone to +08:00 and record min(unix_timestamp(ts_to_time(create_ts))) and min(unix_timestamp(cast(create_ts as timestamp(6)))).
Set the session time zone to -05:00 and run the same two expressions.
Before the fix, both epoch values change by the time-zone offset; the same create_ts no longer represents the same instant.
Resolution
PR #27636 converts the physical component directly, adds precision/NULL boundary coverage, and adds a BVT invariant for both conversion entry points across the two time zones.
Activity
fix: preserve instant in transaction timestamp conversion (#27636)
fix: preserve instant in transaction timestamp conversion (matrixorig…
fix: preserve instant in transaction timestamp conversion (matrixorig…
fix: preserve instant in transaction timestamp conversion (matrixorig…