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]: DATE/DATETIME numeric casts use epoch values instead of MySQL packed temporal numbers #25263
MatrixOne uses epoch-style values for DATE / DATETIME, and DATE -> DECIMAL errors:
select cast(cast('2024-01-02' as date) as signed); -- 19724
select cast(cast('2024-01-02' as date) as decimal(20,0)); -- ERROR 20203: invalid argument operator cast, bad value [DATE DECIMAL128]
select cast('2024-01-02' as date) + 0; -- 19724
select cast(cast('2024-01-02 03:04:05.123456' as datetime(6)) as signed); -- 1704164645
select cast(cast('2024-01-02 03:04:05.123456' as datetime(6)) as decimal(20,6)); -- 1704164645.123456
select cast('2024-01-02 03:04:05.123456' as datetime(6)) + 0; -- 1704164645.123456
TIME -> numeric was checked separately and matches MySQL:
select cast(cast('03:04:05.123456'astime(6)) as signed),
cast(cast('03:04:05.123456'astime(6)) asdecimal(20,6)),
cast('03:04:05.123456'astime(6)) +0;
Both MySQL and MatrixOne return:
30405 30405.123456 30405.123456
Notes
Found during Batch A of the MySQL compatibility type-conversion exploration. Existing TimeToInt.sql covers temporal-to-numeric behavior broadly, so no duplicate passing BVT was added for the matching TIME rows; the differing DATE/DATETIME rows were excluded from BVT.
Activity
add mysql compatibility type conversion and comparison bvt cases (#25219
fix temporal (#25730)
fix temporal part 2 (#25899)
daviszhen commentedon Jul 30, 2026
fixed
Ariznawlll commentedon Jul 30, 2026
测试版本
main(截至 2026-07-30 16:30,Asia/Shanghai)41332062a6740978f269088a92ee362a888c7bd7etc/launch-with-proxy/launch.toml(2 CN + 1 TN + Proxy),SQL 入口127.0.0.1:6001原问题验证
DATE/DATETIME 转 SIGNED、DECIMAL 和
+0均返回 MySQL packed temporal number:DATE 为20240102,DATETIME(6) 为20240102030405.123456;完整黑盒 3/3 通过。Happy Path 覆盖
2000-02-29转为20000229。9999-12-31 23:59:59.999999保留完整 packed 值和微秒。30405/30405.123456,未被 DATE/DATETIME 修复破坏。Unhappy Path 覆盖
not-a-date转 DATE 返回 NULL,后续SELECT 1正常。白盒验证
temporal cast/binder 定向测试通过;最终 SQL 和额外非法输入输出均已保存为证据。
回归测试
修复提交
5c3243d2f已扩展 temporal predicate、zero temporal、load-data 与函数 BVT/UT。测试证据
完整 3 轮 SQL 结果、测试脚本、Proxy 黑盒日志、定向 UT 与
-race输出:https://gist.github.com/Ariznawlll/b8f1a22642a58fd5264482687534728b测试结论
测试通过。
Ariznawlll commentedon Jul 30, 2026
motr 黑盒回归已补充
suites/14_issue_regression/t/issue_25263_temporal_numeric_cast.testmain@41332062a6740978f269088a92ee362a888c7bd7,该批 14 个用例连续 3 轮为 42/42 成功(504/504 语句);完整14_issue_regressionsuite 为 124 成功、0 失败。add mysql compatibility type conversion and comparison bvt cases (mat…
fix temporal (matrixorigin#25730)
fix temporal part 2 (matrixorigin#25899)
add mysql compatibility type conversion and comparison bvt cases (mat…
fix temporal (matrixorigin#25730)
fix temporal part 2 (matrixorigin#25899)
add mysql compatibility type conversion and comparison bvt cases (mat…
fix temporal (matrixorigin#25730)
fix temporal part 2 (matrixorigin#25899)