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]: inconsistent fractional-second precision for TIME/DATETIME/TIMESTAMP across storage, casts, and functions #22701
Values were stored at full microsecond precision while declared precision (scale) was only applied at display, causing mismatches in storage, comparisons, and query results.
CAST between TIME/DATETIME/TIMESTAMP did not consistently round/truncate to target scale; some paths preserved full precision.
Built-ins (NOW/CURRENT_TIMESTAMP/SYSDATE) didn’t consistently honor requested precision; default NOW() behavior caused test flakiness.
String-to-datetime casts were forced to scale=6 via type inference even when the target type had lower scale, producing incorrect equality and grouping behavior.
TIMEDIFF precision didn’t align with MySQL (result precision should equal the max input precision).
Tests that assumed pre-fix behavior (e.g., TIMESTAMP(0) retaining microseconds) broke or were flaky.
Expected Behavior
Declared fractional-second precision is enforced end-to-end: on storage, in CAST/conversion, and in function outputs.
Rounding uses round-half-up (e.g., .5 rounds up).
String literals are parsed with scale=6, then truncated/rounded when assigned/cast to a lower-scale target (MySQL 8.0 compatible).
TIMEDIFF result precision equals the highest precision of its arguments.
NOW()/CURRENT_TIMESTAMP/SYSDATE respect explicit scales; default NOW() behaves as TIMESTAMP(0).
Equality/grouping/comparisons are deterministic and consistent with the declared scales.
changed the title [-][Bug]: incorrectly applies precision truncation only to display layer while storing full precision on Datetime[/-][+][Bug]: inconsistent fractional-second precision for TIME/DATETIME/TIMESTAMP across storage, casts, and functions[/+]on Oct 30, 2025
Activity
[-][Bug]: incorrectly applies precision truncation only to display layer while storing full precision on Datetime[/-][+][Bug]: inconsistent fractional-second precision for TIME/DATETIME/TIMESTAMP across storage, casts, and functions[/+]