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]: TIME arithmetic returns wrong values and result metadata for multiplication, division, and modulo #28953
The failing fixture is test/distributed/cases/dtype/time.test:
CREATETABLEt1(t TIME(3));
INSERT INTO t1 VALUES (0.001), (34.5);
SELECT t *10FROM t1;
SELECT t /10FROM t1;
SELECT t % 5FROM t1;
Expected values from the fixture:
t * 10 -> 0.010, 345.000
t / 10 -> 0.000100000, 3.450000000
t % 5 -> 0.001, 4.500
Observed BVT values include:
t * 10 -> 0.000
t / 10 -> 0E-9
t % 5 -> 0.000
The BVT also reports a result metadata mismatch: the fixture expects the previous string-like result contract while execution returns a DECIMAL result.
Expected behavior
TIME arithmetic should preserve the documented value semantics, scale/format, and stable result metadata for *, /, and %. The behavior should be consistent across ordinary and prepared/runtime expression paths.
Attribution
Neither the decimal-literal PR (#28825) nor the spatial-distance PR (#28830) modifies the TIME arithmetic implementation. This is a base/shared temporal arithmetic or result-coercion regression.
Related #25705 and #27088 track broader numeric/coercion work but explicitly do not cover this temporal arithmetic manifestation. #28465 is an OCT/TIME parsing issue and is also distinct.
Correction to the original attribution in this issue: the clean CI failure 34937495318 / job 104280571311 ran PR #28825 head 7df20be7d3184b723d416bed709b1be5adec9091. That PR's normalizePlainDecimalLiteral rewrites the numeric literal 0.001 to .001; the string-to-TIME parser returns zero for that spelling before applying the fraction. Therefore the observed failure is not evidence of a current-base TIME arithmetic kernel regression.
PR #28957 has been updated to add a planner-boundary regression guard and explicit client-visible DECIMAL metadata assertions to the existing BVT. The separate prepared expression failure (TIME * ? being typed as TIME TEXT) remains a distinct issue until it has its own design and reproduction coverage.
Activity
XuPeng-SH commentedon Sep 16, 2026
Correction to the original attribution in this issue: the clean CI failure
34937495318/ job104280571311ran PR #28825 head7df20be7d3184b723d416bed709b1be5adec9091. That PR'snormalizePlainDecimalLiteralrewrites the numeric literal0.001to.001; the string-to-TIME parser returns zero for that spelling before applying the fraction. Therefore the observed failure is not evidence of a current-base TIME arithmetic kernel regression.PR #28957 has been updated to add a planner-boundary regression guard and explicit client-visible DECIMAL metadata assertions to the existing BVT. The separate prepared expression failure (
TIME * ?being typed asTIME TEXT) remains a distinct issue until it has its own design and reproduction coverage.test(function): cover fractional TIME arithmetic (#28957)
test(function): cover fractional TIME arithmetic (matrixorigin#28957)
test(function): cover fractional TIME arithmetic (matrixorigin#28957)