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 CREATE TABLE fails for BINARY and VARBINARY primary keys #26075
DATA BRANCH CREATE TABLE ... FROM ... fails for source tables whose primary key is BINARY or VARBINARY. Ordinary table creation and inserts with these primary-key types succeed, but the branch table is not created.
Environment
Branch: main
Commit: 2eb7f523e5a10f352d3e258183ed8440510388de
Version: 8.0.30-MatrixOne-v1.3.0
Steps to reproduce
DROPDATABASE IF EXISTS g4d_branch_binary_pk;
CREATEDATABASEg4d_branch_binary_pk;
USE g4d_branch_binary_pk;
CREATETABLEbinary_base(k BINARY(4) PRIMARY KEY, v INT);
INSERT INTO binary_base VALUES('a', 10), ('b', 20);
DATA BRANCH CREATE TABLE binary_branch FROM binary_base;
CREATETABLEvarbinary_base(k VARBINARY(8) PRIMARY KEY, v INT);
INSERT INTO varbinary_base VALUES('a', 10), ('b', 20);
DATA BRANCH CREATE TABLE varbinary_branch FROM varbinary_base;
Actual result
Both branch creation statements return an internal error from the merge-sort path:
The stack starts at pkg/objectio/mergeutil.MergeSortBatches and passes through the sinker spill-sort path.
After each failure, the target branch table does not exist and no active branch metadata remains. The result reproduced in 3 out of 3 runs.
Expected result
Data Branch should create a branch from tables with BINARY and VARBINARY primary keys without returning an internal error, or reject unsupported types with a clear validation error before starting the operation.
Activity
fix(data branch): support binary primary keys (#26559)
gouhongshen commentedon Aug 2, 2026
fixed
Ariznawlll commentedon Aug 4, 2026
测试版本
mainc58cd292d3e6e039a8882654d3b20ad345171e87原问题验证
使用 BINARY/VARBINARY 主键重新执行
DATA BRANCH CREATE TABLE、DIFF 和 MERGE,branch 创建及后续 apply 均成功,没有再出现 binary PK merge/sort 失败。Happy Path 覆盖
BINARY(16)主键覆盖 5,000 行,创建和 MERGE 后完整数据一致。Unhappy Path 覆盖
白盒验证
执行
TestMergeSortBatchesBinaryTypes,验证 binary/varbinary batch merge-sort;连续执行 3 轮通过。回归测试
test/distributed/cases/git4data/branch/edge/branch_binary_pk.sql测试证据
rows=12000 payload_bytes=1024 composite_rows=5000,最终完整数据相等。测试结论
测试通过。
fix(data branch): support binary primary keys (matrixorigin#26559)
fix(data branch): support binary primary keys (matrixorigin#26559)
fix(data branch): support binary primary keys (matrixorigin#26559)