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
[Compatibility]: FROM_UNIXTIME rejects negative and post-2038 values in the valid DATETIME range #28144
FROM_UNIXTIME(-1) 与整数上界外输入保持 NULL;该结果符合 issue 后续对 MySQL 实测的范围说明。
白盒验证
执行 go test -vet=off ./pkg/sql/plan/function -run 'TestFromUnixTimeDomainPrecisionAndFormatting|TestFromUnixTimeDecimalHighScaleRoundsOnce' -count=1,通过。
Activity
Ariznawlll commentedon Sep 10, 2026
在最新
mainac660ae56ecd37bab3dd8c61193617a323377029上补充一个合法上界缺口:整数最大值可用,但该秒内的合法小数部分被拒绝。后两条在 MatrixOne 返回
NULL,MySQL 8.0.46 分别返回:因此
UNIX_TIMESTAMP(FROM_UNIXTIME(32536771199.999999))在 MatrixOne 为NULL,MySQL 可正确往返为32536771199.999999。代码上,
decimal256UnixTimeParts在sec == maxUnixTimestampInt && nsec > 0时一律判为越界,把最大秒内仍合法的 999999 微秒全部排除了。完整边界场景重复 3 次一致。另外,MySQL 对负数和真正超过
32536771199.999999的输入返回NULL,所以本 issue 最准确的修复范围是“接受最大秒内的小数部分”,不需要把越界结果改成数值0。fix temporal precision, prepared binding, and boundary semantics (#28316
jiangxinmeng1 commentedon Sep 14, 2026
fixed by #28316
Ariznawlll commentedon Sep 14, 2026
测试版本
mainbe30a70fe50eac4e8c78e5117fdd69179ba853e0mo-service,独立数据目录,sessiontime_zone='+00:00'原问题验证
按 issue 后续澄清的有效上界复测
FROM_UNIXTIME(CAST(32536771199.9999994 AS DECIMAL(20,7))),连续 3 次均为3001-01-18 23:59:59.999999;此前会被误判为越界的最大秒内小数部分已保留。Happy Path 覆盖
TIMESTAMP(6)生成 epoch 后经FROM_UNIXTIME的普通转换在 CTAS 中仍保留123456微秒,作为运行时正常值控制。Unhappy Path 覆盖
32536771199.9999995舍入后越过最大值,3/3 返回NULL,未生成越界日期。FROM_UNIXTIME(-1)与整数上界外输入保持NULL;该结果符合 issue 后续对 MySQL 实测的范围说明。白盒验证
执行
go test -vet=off ./pkg/sql/plan/function -run 'TestFromUnixTimeDomainPrecisionAndFormatting|TestFromUnixTimeDecimalHighScaleRoundsOnce' -count=1,通过。回归测试
issue_28121_28123_28124_28122_28144_temporal_ctas.test./motr --repeat 3 14_issue_regression.issue_28121_28123_28124_28122_28144_temporal_ctas:3/3 通过,66/66 statements。测试证据
定向结果与 PR 基线见 MOTR PR #170。该 case 在
14_issue_regression套件实跑中为 22/22 statements 通过;套件内其他既有 case 存在无关失败,未改动其期望结果。测试结论
测试通过。
fix temporal precision, prepared binding, and boundary semantics (mat…
fix temporal precision, prepared binding, and boundary semantics (mat…
fix temporal precision, prepared binding, and boundary semantics (mat…