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 and BIT multiplication narrows UINT64 values before Decimal128 evaluation #29469
main history; reproduced using the clean direct-parent benchmark binary for 1575e70c3db676d3ed00abc080aadc029b0e1435, fresh copy of its data snapshot, Linux amd64, local single CN on NVMe. Discovered while reviewing #29462; these ordinary SQL failures do not require prepared execution.
Actual behavior
createtablenumeric_domains(t time(0), f time(6), u bigint unsigned, b bit(64), d decimal(5,2));
insert into numeric_domains values('00:00:01','00:00:01.500000',18446744073709551615,18446744073709551615,1.25);
select t*u,u*t,f*u,b*t,b*d from numeric_domains;
The shared cast table selects Decimal64 for TIME with UINT64/BIT. Decimal64's signed coefficient cannot represent the full unsigned source domain, so conversion loses the value before the Decimal128 multiplication result is produced. MULTI's existing Decimal128-to-Decimal64 fast path separately omits BIT from its unsigned guard.
The correction under review in #29462 selects an adequate implicit multiplication operand domain, shares the UINT64/BIT exclusion with the existing fast path, preserves each operand's scale, and does not cross explicit CAST boundaries. Ordinary columns and the existing binary-prepared TIME arithmetic case pass locally. Other arithmetic operators and explicit CAST policy are outside this multiplication correction. Final PR review/performance acceptance remains pending.
Activity
fix: restore prepared TPCC filter selectivity with per-binding proof (#…
Ariznawlll commentedon Oct 2, 2026
测试版本
maind50a2d475a406829f67127fef7b2ad4abc1c1d3dmo-service,独立数据目录;MySQL 文本协议与 server-side PREPARE原问题验证
按 issue 原始语义在上述 commit 重新执行并重复 3 次。UINT64 与 DECIMAL 运算保留完整精度,最大无符号值附近乘积正确。
Happy Path 覆盖
覆盖小值和 2^63、UINT64 上界附近值。
Unhappy Path 覆盖
覆盖乘积溢出、负 DECIMAL、NULL;不经 FLOAT64 丢精度。
白盒验证
关联修复 #29462 已进入当前
main。同时将本 issue 的可公开观察契约固化为独立回归,避免只依赖实现细节或共享测试间接判断。回归测试
suites/14_issue_regression/t/issue_recent_sql_semantics.test714/714条语句通过。测试证据
d50a2d475a406829f67127fef7b2ad4abc1c1d3d14_issue_regression中观察到的旧 GOROOT/历史 golden/并发锁冲突属于既有无关失败,以上新增用例单独重跑均稳定通过。测试结论
测试通过。