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_ADD and TIMESTAMPADD MICROSECOND overflow produce year 10000 or zero dates #28142
QA handoff after merged PR #28851 (merge a99db843c7b4630a86883addc9424433d93fc2d2). This issue was a non-closing related report; the merge and shared BVT counts are not an independent PASS for this reproducer.
Latest MatrixOne contract: C01, C03, C20 in the merged temporal design. DATE_ADD/SUB and TIMESTAMPADD MICROSECOND must never publish year 10000 or a fabricated zero date from ordinary calendar overflow. An evaluated out-of-domain arithmetic result is row NULL plus warning 1441.
Please rerun the original reproducer on main at or after the merge and record the exact SHA, deployment, SQL mode/time zone, client path, observed rows/types/NULLs and active warnings or errors. Rerun the original string underflow and DATETIME ADDTIME overflow that previously remained after #28316, as well as typed TIMESTAMP upper/lower and valid adjacent controls.
Keep the issue open until the issue-specific acceptance is demonstrated with happy and unhappy controls. If any part still fails, post the exact observed-versus-expected result and return it to development; if it passes, record evidence and close the issue. @Ariznawlll
Activity
Ariznawlll commentedon Sep 10, 2026
补充
ADDTIME独立执行路径的同类边界现象。latest mainac660ae56ecd37bab3dd8c61193617a323377029:MatrixOne 返回:
且没有 warning。MySQL 8.0.46 对相同语句返回
NULL,并产生Warning 1441: Datetime function: add_time field overflow。该现象在以下路径中一致:
sql_mode=''和STRICT_TRANS_TABLES;普通范围及未越界的上界控制保持正确;越界值进入 CTAS/
INSERT ... SELECT时会进一步触发物化错误。代码上这不是本 issue 已列出的
DATE_ADD/TIMESTAMPADD微秒分支:pkg/sql/plan/function/func_binary.go的addTimeToDatetime直接执行types.Datetime(int64(dt) + int64(time2))后 append,没有校验结果是否仍处于 DATETIME 上界内。建议修复 #28142 时一并覆盖ADDTIME路径。fix temporal precision, prepared binding, and boundary semantics (#28316
jiangxinmeng1 commentedon Sep 14, 2026
fixed by #28316
Ariznawlll commentedon Sep 14, 2026
测试版本
main7ffce04a0921c684ccfe92863eac5f56279068fcmo-service,独立数据目录,sessiontime_zone='+00:00'原问题验证
在 PR #28316 已合入后的最新
main复测 3 次,DATE_ADD(CAST('9999-12-31 23:59:59.999999' AS TIMESTAMP(6)), INTERVAL 1 MICROSECOND)和TIMESTAMPADD(MICROSECOND, 1, CAST('9999-12-31 23:59:59.999999' AS TIMESTAMP(6)))均为NULL;但 issue 原始字符串路径仍未修复:同时,issue 已补充的同类
ADDTIME路径也仍可复现:Happy Path 覆盖
DATE_ADD(CAST('2024-01-01 00:00:00.123456' AS DATETIME(6)), INTERVAL 1 MICROSECOND)连续 3 次均为2024-01-01 00:00:00.123457。DATE_ADD与TIMESTAMPADD的已修复上界TIMESTAMP(6)分支连续 3 次均返回NULL。Unhappy Path 覆盖
DATE_SUB下溢连续 3 次生成零日期,而非NULL或标准溢出处理。ADDTIME上溢连续 3 次生成年份10000,该值超出 DATETIME 合法范围。白盒验证
执行
go test -vet=off ./pkg/sql/plan/function -run 'TestTemporalMicrosecondBoundaryOverflowIsNull' -count=1,通过。该现有单测覆盖 typedDATE_ADD/TIMESTAMPADD边界,未覆盖上述字符串DATE_SUB与ADDTIME残留路径;黑盒复现证明该覆盖不足以验收本 issue。回归测试
当前存在产品失败,未将错误结果写入 MOTR 基线。待修复后应在 PR #28316 所在时间函数覆盖中补充字符串
DATE_SUB下溢及ADDTIME上溢断言,再加入稳定 SQL 回归。测试证据
复现命令与结果保存在本次验证输出:
temporal-residual-latest.sql,三轮输出逐字节一致;关键输出为0000-00-00 00:00:00.000000和10000-01-01 00:00:00。修复关联 PR:matrixone#28316。@jiangxinmeng1 请继续处理这两个残留分支。测试结论
测试不通过。
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…
fix: align date compatibility semantics (#28851)
XuPeng-SH commentedon Sep 27, 2026
QA handoff after merged PR #28851 (merge
a99db843c7b4630a86883addc9424433d93fc2d2). This issue was a non-closing related report; the merge and shared BVT counts are not an independent PASS for this reproducer.Latest MatrixOne contract: C01, C03, C20 in the merged temporal design. DATE_ADD/SUB and TIMESTAMPADD MICROSECOND must never publish year 10000 or a fabricated zero date from ordinary calendar overflow. An evaluated out-of-domain arithmetic result is row NULL plus warning 1441.
Please rerun the original reproducer on
mainat or after the merge and record the exact SHA, deployment, SQL mode/time zone, client path, observed rows/types/NULLs and active warnings or errors. Rerun the original string underflow and DATETIME ADDTIME overflow that previously remained after #28316, as well as typed TIMESTAMP upper/lower and valid adjacent controls.Keep the issue open until the issue-specific acceptance is demonstrated with happy and unhappy controls. If any part still fails, post the exact observed-versus-expected result and return it to development; if it passes, record evidence and close the issue. @Ariznawlll
Ariznawlll commentedon Oct 2, 2026
测试版本
maind50a2d475a406829f67127fef7b2ad4abc1c1d3dmo-service,独立数据目录;MySQL 文本协议与 server-side PREPARE原问题验证
按 issue 原始语义在上述 commit 重新执行并重复 3 次。DATE_ADD、DATE_SUB、TIMESTAMPADD 和 ADDTIME 的上下界溢出均返回 NULL,不再生成 year 10000 或伪造 zero date。
Happy Path 覆盖
覆盖未越界的 0001/9999 边界和微秒精度保留。
Unhappy Path 覆盖
覆盖上下界各越过 1 微秒,结果为 NULL 并保留对应 warning;无 CTAS 物化异常。
白盒验证
关联修复 #28316、#28851 已进入当前
main。同时将本 issue 的可公开观察契约固化为独立回归,避免只依赖实现细节或共享测试间接判断。回归测试
suites/14_issue_regression/t/issue_recent_temporal_contracts.test714/714条语句通过。测试证据
d50a2d475a406829f67127fef7b2ad4abc1c1d3d14_issue_regression中观察到的旧 GOROOT/历史 golden/并发锁冲突属于既有无关失败,以上新增用例单独重跑均稳定通过。测试结论
测试通过。