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 MERGE and PICK cannot apply changes after an equivalent column rename #26062
DATA BRANCH DIFF treats a one-sided column rename as schema-equivalent and can correctly compare the two tables, but DATA BRANCH MERGE and DATA BRANCH PICK cannot apply the same change set.
The apply stage builds its SQL with the source-side column names. If the source column was renamed, the destination rejects the new name; if only the destination was renamed, the destination rejects the old name. The behavior is symmetric and affects both MERGE and PICK.
Tested at commit 2eb7f523e5a10f352d3e258183ed8440510388de.
Steps to reproduce
dropdatabase if exists g4d_rename_apply;
createdatabaseg4d_rename_apply;
use g4d_rename_apply;
createtablebase(id intprimary key, payload int);
insert into base values (1,10),(2,20);
data branch create table src from base;
altertable src rename column payload to payload_new;
update src set payload_new=11where id=1;
insert into src values (3,30);
data branch diff src against base;
data branch merge src into base;
select*from base order by id;
The same result occurs with:
data branch pick src into base keys(1,3) when conflict accept;
It also occurs in the reverse direction when the destination column is renamed and the source retains the original name.
Actual behavior
With the source renamed:
ERROR 20301 (HY000): invalid input: column payload_new does not exist
With the destination renamed:
ERROR 20301 (HY000): invalid input: column payload does not exist
The destination rows remain unchanged.
Expected behavior
MERGE and PICK should map columns by the same stable column identity used by schema-equivalence and DIFF, so a one-sided rename can be applied to the destination column name.
Reproducibility
Reproduced in 3/3 runs for all four combinations:
MERGE with source renamed
MERGE with destination renamed
PICK with source renamed
PICK with destination renamed
Code context
isSchemaEquivalent intentionally allows different column names when column IDs and logical types match. The apply path later derives visible column names from the source table definition, and those names are used when writing to the destination table.
Activity
fix(data branch): apply changes after column renames (#26588)
gouhongshen commentedon Aug 3, 2026
fixed
Ariznawlll commentedon Aug 4, 2026
测试版本
mainc58cd292d3e6e039a8882654d3b20ad345171e87原问题验证
在 branch 创建后对等价逻辑列执行 rename,再重跑 PICK 和 MERGE。apply 使用逻辑列身份完成映射,不再因为端点列名不同而失败;连续执行 3 轮通过。
Happy Path 覆盖
Unhappy Path 覆盖
WHEN CONFLICT FAIL,语句返回冲突。白盒验证
定向覆盖历史 LCA probe 列布局、source-to-target index 映射、destination column name 和 renamed PK compatibility;相关测试连续执行 3 轮通过。
回归测试
test/distributed/cases/git4data/branch/edge/branch_rename_apply.sql测试证据
测试结论
测试通过。
fix(data branch): apply changes after column renames (matrixorigin#26588
fix(data branch): apply changes after column renames (matrixorigin#26588
fix(data branch): apply changes after column renames (matrixorigin#26588