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]: CAST overflow handling differs from MySQL clamp/wrap behavior #25252
MySQL returns saturated/wrapped cast results with warnings:
-1
18446744073709551615
9999.99
Actual Behavior
MatrixOne returns errors:
ERROR 1690 (HY000): data out of range: data type int64, value '999999999999999999999999'
ERROR 1690 (HY000): data out of range: data type uint64, value '999999999999999999999999'
ERROR 20301 (HY000): invalid input: 9999999.99 beyond the range, can't be converted to Decimal64(6,2).
Notes
Found during Batch A of the MySQL compatibility cast matrix. Overflow rows were excluded from passing BVT.
cast(... as signed)
-1
cast(... as unsigned)
18446744073709551615
cast(... as decimal(6,2))
9999.99
cast(-1 as unsigned)
18446744073709551615
补充验证合法边界和负数 DECIMAL 溢出:
select cast('9223372036854775807'as signed) as signed_max,
cast('18446744073709551615'as unsigned) as unsigned_max;
select cast('9999.994'asdecimal(6,2)) as decimal_in_range,
cast('-9999999.99'asdecimal(6,2)) as decimal_negative_overflow;
Activity
Ariznawlll commentedon Jun 30, 2026
Additional Batch A cast-matrix row with the same MySQL wrap/clamp vs MatrixOne range-error behavior:
MySQL returns:
MatrixOne on latest
origin/main(33e96877604ad4b847ea7d5c55eb09429de1a5b6) returns:This row was excluded from passing BVT.
add mysql compatibility type conversion and comparison bvt cases (#25219
Ariznawlll commentedon Jul 21, 2026
已在最新
main分支完成验证,issue 中记录的显式CAST溢出行为已修复。测试版本
main3046f14d94b3f1a25839eeeb65729b64f85ac647git_version():3046f14d9测试步骤
6001端口并执行 issue 原始用例及补充用例:实际输出:
实际输出:
测试结论
最新
main上,显式CAST的超大有符号整数、超大无符号整数、负数转无符号整数以及 DECIMAL 超范围场景,均已按 MySQL 兼容语义返回 wrap/clamp 结果,不再返回原 issue 中的 range error。合法 signed/unsigned 边界值保持不变,正负 DECIMAL 溢出均正确收敛到目标精度范围,原问题验证通过。Ariznawlll commentedon Jul 21, 2026
已补充 motr 黑盒回归测试:matrixorigin/motr#61。
回归内容包括:
SIGNED/UNSIGNED的 wrap 行为;-1显式转换为UNSIGNED;在 MatrixOne
main@3046f14d9上连续执行 3 轮,24/24 条 SQL 全部通过。该用例无全局状态修改,可在普通并行回归池执行,无需独占。add mysql compatibility type conversion and comparison bvt cases (mat…
add mysql compatibility type conversion and comparison bvt cases (mat…
add mysql compatibility type conversion and comparison bvt cases (mat…