Repository navigation
Description
Description
With save_query_result=ON, DATA BRANCH DIFF of a changed DATETIME(6) column terminates the MatrixOne service process. The client loses its connection. The same diff works when saving is OFF, and an ordinary saved SELECT of the same DATETIME value works.
Environment
maincommitf847803802289b2b2d0df4f0a2f842c2804b823a(git_version() = f847803802)- Isolated local standalone, one CN, macOS arm64
Minimal reproduction
CREATE DATABASE branch_datetime_repro;
USE branch_datetime_repro;
CREATE TABLE b (id INT PRIMARY KEY, v DATETIME(6));
INSERT INTO b VALUES (1, '2024-01-01 00:00:00.123456');
DATA BRANCH CREATE TABLE c FROM b;
UPDATE c SET v = '2024-01-02 00:00:00.654321' WHERE id = 1;
SET save_query_result = OFF;
DATA BRANCH DIFF c AGAINST b;
-- Returns c, UPDATE, 1, 2024-01-02 00:00:00.654321
SET save_query_result = ON;
/* save_result */ SELECT v FROM c;
SET @control_qid = last_query_id();
SELECT * FROM result_scan(@control_qid) AS r;
-- Both return the exact DATETIME value with microseconds
DATA BRANCH DIFF c AGAINST b;
-- Connection lost; standalone process exits with code 2Actual and expected
The server logs panic: interface conversion: interface {} is string, not types.Datetime at pkg/frontend/util.go:1756. The call chain is convertRowsIntoBatch → trySaveQueryResult → satisfyDiffOutputOpt → a goroutine created by diffMergeAgency. The expected result is the same updated row as with result saving OFF, with a saved result that preserves its DATETIME value. A query-result option must not terminate the service.
Stability and controls
- Reproduced 3/3 in fresh databases
qbranchdatetime_04/05/06, each after a separate service restart; all three server processes exited with code 2 and the same panic stack. The initial mixed-type caseqbranchprec_01also hit the same panic, but was not counted among the three minimal runs. - OFF control returned the correct updated row in each run. ON ordinary SELECT plus
RESULT_SCANpreserved the exact microseconds in runs 05/06. The failure occurs specifically in frontend saving of the branch-diff result. - This was tested only on an isolated single-CN deployment; all sessions using that process lost service availability. No data-mutation claim is made from the crash itself.
Code analysis
convertRowsIntoBatch asserts that the frontend row contains types.Datetime. This diff path supplies a string. The assertion happens in a diff worker goroutine, so the panic is not returned as a SQL error and the service exits. This differs from #31498's unsigned integer count assertion and from #31534's explicit unsupported MySQL type error.
Activity
Ariznawlll commentedon Oct 28, 2026
结论
测试不通过。同一结果保存转换缺陷还会影响
TIME(6):保存DATA BRANCH DIFF时服务进程退出。这是 #31547 的同根类型扩展,不新建重复 issue。关键证据
main@f847803802289b2b2d0df4f0a2f842c2804b823a;本地隔离单 CN 集群。qbranchtime_01/02/03稳定复现:TIME(6)列从01:02:03.123456更新为04:05:06.654321后,save_query_result=OFF的 DIFF 返回正确微秒值;save_query_result=ON时客户端收到 2013,服务退出码为 2。TIME(6)值的普通SELECT结果保存和RESULT_SCAN精确返回04:05:06.654321。pkg/frontend/util.go:1742的convertRowsIntoBatch:panic: interface conversion: interface {} is string, not types.Time,上层同样经过query_result.go:459和data_branch_output.go:1378。复现脚本:/private/tmp/mo-explore-run-20261028/data_branch_time_probe.py。待解决点
TIME,不应对 DIFF 输出中的字符串直接断言为types.Time。DATETIME(6)与TIME(6),并校验微秒值、连接可用性和进程存活。fix(frontend): honor column signedness when saving query results (#31498
fix: reject invalid global time_zone, save DATA BRANCH DIFF temporal …
XuPeng-SH commentedon Nov 14, 2026
QA 交接:已合并修复,待验收
PR #32456 已合入 main,merge SHA
625865c470631f33da52793a2e2766d63e5a316e,最终 head86d6fbf32cfb96ed8e0155d6124cec3e568ae4cb。证据边界:最终 head 的评审 #32456 (review) 复用 shared build、Ubuntu/x86 UT、arm64 SCA、coverage、PROXY/PESSIMISTIC BVT 成功结论;合并记录 CI Required 成功,队列未重跑 CI。评审只新做 diff check,未新跑 Go/集群,原始 CI/作者日志未供其复核。作者报告定向 BVT 57/57、system_variable 636/636、branch/diff 1976/1976;snapshot 18389/18454,65 项资源准入失败,不能称全目录通过。上述为远端记录和作者报告,本轮没有本地构建或实测。
修复 DATE/TIME/DATETIME 原生值及文本转换,按声明 scale 解析并保留小数秒,避免保存 DIFF 时直接类型断言导致进程退出。旧评论 6462549743 的 TIME(6) 反例来自旧 main f847803;本次明确包含 TIME 与 DATETIME 回归,不能直接当作合并版本反例。
QA 建议在隔离实例重复新库 DATETIME(6)/TIME(6) 的 OFF/ON 对照、普通保存 SELECT、RESULT_SCAN 精确微秒读回、NULL/非法类型失败边界,并确认连接和进程存活;补多 CN 验证。不是对其他保存类型或全部 DIFF 问题的验收。
交 Ariznawlll 验证,保持 open;转测不代表验收通过,本轮未运行测试。
Ariznawlll commentedon Nov 15, 2026
结论
测试通过。main 上原 DATETIME/TIME 保存 DIFF 导致服务退出的问题未再复现。
关键证据
mainc71e0c6904f444f45c4f4095be0e9f088b0c3b50,包含修复 PR fix: reject invalid global time_zone, save DATA BRANCH DIFF temporal results, reject snapshot-qualified write targets #32456;独立 Linux 容器、1 TN/LogService、双 CN,两个 CN 的git_version()均核对为该完整 SHA。未将本结果外推到 4.2-dev。14_issue_regression931 项中 800 通过、12 失败、119 跳过;12 项失败与更早同版本基线名单一致,不能称整套 CI 全绿。最新一轮结果同为 800 通过、12 失败、119 跳过,失败名单一致。save_query_resultOFF/ON 的 DATA BRANCH DIFF、RESULT_SCAN和 INSERT 到目标表的值;DATETIME(6)、TIME(6) 的微秒值以及 DATE 精确一致。待解决点