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]: Decimal256 rounded division violates full unsigned magnitude contract and forces BigInt fallback #29614
本地证据目录:/home/xupeng/matrixone-qa-evidence/29249-d256-intdiv-20261004/canonical/latest-main。之前 SQL-visible 修复的真实服务 BVT 门槛仍单独保持 open,本报告不将表达式 UT 当作已完成的 server BVT。
Activity
fix: consolidate decimal expression contracts and historical bug regr…
Ariznawlll commentedon Oct 8, 2026
在包含 #29618 的当前 main
bab4b3286a0dd5683a9b291763817722233e586c上补充了 primitive 与 SQL 消费路径验证。底层完整幅值合同:
TestDecimal256UnsignedDivision普通模式连续 100 轮通过;3*10^76 / 10^64 = 3000000000000、最高位完整幅值、跨 limb 商进位、偶/奇除数半界上下、除零错误,以及 2^63–2^256 边界和 200 组固定种子随机值。SQL 消费路径使用
DECIMAL(65,0)补充:3*10^64的普通 AVG 和窗口 AVG 均精确返回3*10^64;10^65-2与10^65-1的 AVG 在.5半界按 half-up 返回10^65-1;-.5半界返回负的10^65-1,符号方向正确;AVG(...) OVER(PARTITION BY ...)结果一致;DECIMAL(65,0)时返回精确范围错误,错误后连接仍可执行查询。本轮没有观察到完整幅值舍入返回 0、跨字 carry 丢失、正负半界不一致或 SQL AVG 路径残留 BigInt 语义差异。
Ariznawlll commentedon Oct 8, 2026
测试版本
MatrixOne 最新 main
1a0088790c8823bd3fe824ad9ff2ef1ce130eb31;本地单 CN/TN。原问题验证
原
Decimal256完整无符号幅值除法边界在现行实现中未再出现截断、错误商或 BigInt 回退差异。正常场景覆盖
原
3×10^76 / 10^64 = 3000000000000和 SQL AVG 正负大数路径结果正确。边界与异常场景覆盖
覆盖最高位、跨 limb 进位、半界舍入、除零、NULL-only 分组及越界 SUM;错误返回后连接仍可使用。
白盒验证
当前 main 执行
go test ./pkg/container/types -run '^TestDecimal256UnsignedDivision$' -count=3通过;此前完整边界集普通 100 轮、race 20 轮也已在 issue 记录。回归测试
这是
pkg/container/types的内部整数 primitive,SQL MOTR 无法直接断言 unsigned limb 商;保留既有 Go UT 与 SQL AVG 消费路径,不新增伪等价 MOTR 用例。测试证据
Go UT
pkg/container/types的TestDecimal256UnsignedDivision;本地最新 main 3/3 通过。测试结论
测试通过。