Repository navigation
Description
Is there an existing issue for the same bug?
- I have checked the existing issues.
Branch Name
main
Commit ID
Other Environment Information
- Deployment: isolated local single-CN service via MySQL protocol
- Test date: 2026-08-26
- Scope: public SQL compatibility validation; no fault injectionActual Behavior
On the latest main commit, every two-argument TIMESTAMP(date, time) form is rejected during function resolution.
- VARCHAR,VARCHAR literal: ERROR 20203: invalid argument function timestamp, bad value [VARCHAR VARCHAR]
- DATE,TIME(6) column: ERROR 20203: invalid argument function timestamp, bad value [DATE TIME]
- Prepared SQL SELECT TIMESTAMP(?, ?): PREPARE is rejected with ERROR 20203: invalid argument function timestamp, bad value [TEXT TEXT]
The three paths were each reproduced in 3 independent complete runs (3/3). The unary control SELECT TIMESTAMP('2024-01-15 12:30:00.123456') succeeded in all three runs. No server panic or hang occurred; the temporary table was still readable and cleanup completed.
Expected Behavior
Support MySQL-compatible TIMESTAMP(date, time) composition: accept date and time arguments and return the corresponding TIMESTAMP, with result precision handled according to the documented type rules. This is the remaining compatibility item split from #24504.
Steps to Reproduce
1. Run on main at 77c9ae710c991b219d1aabfb245cb9109dc5cd3c.
2. Execute:
SELECT TIMESTAMP('2024-01-15', '12:30:00.123456');
3. Execute a DATE/TIME column form:
CREATE TEMPORARY TABLE issue_timestamp_pair (d DATE, t TIME(6));
INSERT INTO issue_timestamp_pair VALUES ('2024-01-15', '12:30:00.123456');
SELECT TIMESTAMP(d, t) FROM issue_timestamp_pair;
4. Execute a prepared form:
PREPARE issue_timestamp_pair_stmt FROM 'SELECT TIMESTAMP(?, ?)';
All three forms are rejected with ERROR 20203 before query execution.Additional information
Code analysis
The function registry lists only one-argument TIMESTAMP overloads (DATE, DATETIME, TIMESTAMP, VARCHAR, CHAR). There is no two-argument overload, so resolution fails before an execution path is selected.
Source:
matrixone/pkg/sql/plan/function/list_builtIn.go
Line 10718 in 77c9ae7
| functionId: TIMESTAMP, |
Regression coverage after the fix
Extend test/distributed/cases/function/func_timestamp.test with literal VARCHAR,VARCHAR, DATE/TIME columns, prepared parameters, precision/NULL/invalid-input boundaries. Existing coverage is unary-only.
Related
Split from #24504. The original Feature Request is being closed because this remaining unsupported behavior is tracked independently here.
Activity
VioletQwQ-0 commentedon Aug 27, 2026
QA handoff
matrixorigin/matrixone#27722,已合并。900f28c66a5de7efebce91c6217766d07b69b73b;merge commit:c34f6ed28bc9587e9413d3d2468336fb82ff1407;当前main:c34f6ed28bc9587e9413d3d2468336fb82ff1407。TIMESTAMP(date, time)SQL 兼容语义,需部署环境验收。BUILD MO DOCKER IMAGE在docker/setup-qemu-action拉取tonistiigi/binfmt:latest时因registry-1.docker.io返回 EOF 失败,镜像构建及后续 TKE BVT/性能场景未开始;该失败是 registry/runner setup 症状,不是产品 SQL 终态证据。main上验证 DATE/DATETIME/TIMESTAMP/TIME 及字符、紧凑 DATETIME 输入的两参数结果,覆盖时区、正负跨日、NULL/非法值、上下界、FSP/元数据、prepared statement 和 CTAS;同时确认原有单参数TIMESTAMP语义不变。NULL、FSP/可空性及单参数兼容性正确;FAIL 必须包含同样的版本/环境信息、失败步骤、终端结果和日志症状,issue 保持 OPEN。Ariznawlll,按规则选择 tester:Ariznawlll。Issue 保持 OPEN,已添加
phase/testing,等待 tester 给出包含版本、环境和终态的明确 PASS 或 FAIL。Ariznawlll commentedon Aug 28, 2026
测试版本
maine5f26b66195373f9bff512ac9f428788d1c07e8cmo-service,通过 MySQL 协议执行公开 SQL原问题验证
重新执行原始两参数
TIMESTAMP(date, time)场景。TIMESTAMP('2024-01-15', '12:30:00.123456')正确返回2024-01-15 12:30:00.123456;DATE/TIME 列组合及 SQL PREPARE 两参数形式也均可正常执行,不再出现ERROR 20203 ... bad value [VARCHAR VARCHAR]。新增回归用例连续执行 3/3 通过,随后单独复跑及所在套件执行也通过。Happy Path 覆盖
DATE + TIME(6)、DATETIME(3) + TIME(0)、TIMESTAMP(3) + TIME(6),日期、时间和 FSP 均正确。2024-01-02 + -25:00:00返回2023-12-31 23:00:00;2024-01-01 23:30:00 + 02:00:00返回2024-01-02 01:30:00。20240115120000.123456和123000均按预期解析。DATETIME(6)、DATETIME(0)、DATETIME(1)、DATETIME(6),可空性均为YES。+00:00切换到+08:00后,TIMESTAMP 输入组合返回2024-01-15 20:30:00.123456。TIMESTAMP('2024-01-15 12:30:00')仍返回原值,兼容行为未改变。Unhappy Path 覆盖
9999-12-31 23:59:59.999999 + 1us和下界0001-01-01 - 1us:结果均为 NULL。白盒验证
不适用。本 Issue 是公开 SQL 函数解析、执行及结果元数据问题,已通过真实 MySQL 协议端到端覆盖,无需故障注入。
回归测试
测试证据
14_issue_regression全套:本用例 26/26 statements 通过。b0ae66c0可复现ERROR 20203: invalid argument function timestamp, bad value [VARCHAR VARCHAR];上述 latest main 不再复现。测试结论
测试通过。