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]: DATA BRANCH AST SQL formatting panics for CREATE, DELETE, DIFF, and MERGE #26032
The AST nodes for several valid DATA BRANCH statements cannot be restored to SQL. Calling tree.String on the parsed statement panics with implement me.
The affected statements are:
DATA BRANCH CREATE TABLE
DATA BRANCH DELETE TABLE
DATA BRANCH CREATE DATABASE
DATA BRANCH DELETE DATABASE
DATA BRANCH DIFF
DATA BRANCH MERGE
DATA BRANCH PICK implements the same formatter interface and restores successfully.
The same result occurs for the other affected statements listed above. The check was repeated three times. As a control, the following statement formats normally:
DATA BRANCH PICK child INTO parent KEYS (1) WHEN CONFLICT SKIP;
Actual result
panic: implement me
The panic comes from the statement's Format implementation in pkg/sql/parsers/tree/data_branch.go. The corresponding TypeName methods are also unimplemented.
Expected result
Every valid data-branch AST should implement the standard formatter contract and restore to equivalent SQL without panicking.
Additional context
The current lifecycle unit tests explicitly expect these formatter calls to panic, so the missing implementations are not detected as failures by the existing suite.
go test ./pkg/sql/parsers/tree \
-run '^(TestDataBranchStatementFormatRoundTrip|TestDataBranchPickFormatRoundTrip|TestDataBranchDiffFormatOutputOptions|TestDataBranchMergeFormatConflictOptions)$' \
-count=3
Activity
gouhongshen commentedon Aug 2, 2026
fixed
Ariznawlll commentedon Aug 4, 2026
测试版本
mainc58cd292d3e6e039a8882654d3b20ad345171e87原问题验证
对
DATA BRANCH CREATE/DELETE TABLE、CREATE/DELETE DATABASE、DIFF、MERGE的合法 AST 执行 SQL 格式化和重新解析。原来会触发panic: implement me的路径现在均可完成 round-trip,连续执行 3 轮没有 panic。Happy Path 覆盖
Unhappy Path 覆盖
白盒验证
执行:
结果:
ok github.com/matrixorigin/matrixone/pkg/sql/parsers/tree。回归测试
pkg/sql/parsers/tree/data_branch_test.go测试证据
测试结论
测试通过。