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 PICK literal KEYS rejects BOOL and BIT primary keys #26074
DATA BRANCH PICK ... KEYS(...) rejects literal keys when the primary key type is BOOL or BIT, even though the same operation succeeds when the key is provided by a typed subquery.
The literal path and subquery path therefore support different primary-key type sets.
Environment
Branch: main
Commit: 2eb7f523e5a10f352d3e258183ed8440510388de
Version: 8.0.30-MatrixOne-v1.3.0
Steps to reproduce
DROPDATABASE IF EXISTS g4d_pick_bool_bit;
CREATEDATABASEg4d_pick_bool_bit;
USE g4d_pick_bool_bit;
CREATETABLEbool_base(k BOOL PRIMARY KEY, v INT);
INSERT INTO bool_base VALUES(FALSE, 10), (TRUE, 20);
DATA BRANCH CREATE TABLE bool_src FROM bool_base;
DATA BRANCH CREATE TABLE bool_dst FROM bool_base;
UPDATE bool_src SET v = v +100;
DATA BRANCH PICK bool_src INTO bool_dst KEYS(1);
DATA BRANCH PICK bool_src INTO bool_dst KEYS(TRUE);
-- Control: the same BOOL key succeeds through the typed subquery path.
DATA BRANCH PICK bool_src INTO bool_dst
KEYS(SELECT k FROM bool_src ORDER BY k DESCLIMIT1);
CREATETABLEbit_base(k BIT(8) PRIMARY KEY, v INT);
INSERT INTO bit_base VALUES(b'00000001', 10), (b'00000010', 20);
DATA BRANCH CREATE TABLE bit_src FROM bit_base;
DATA BRANCH CREATE TABLE bit_dst FROM bit_base;
UPDATE bit_src SET v = v +100;
DATA BRANCH PICK bit_src INTO bit_dst KEYS(1);
-- Control: the same BIT key succeeds through the typed subquery path.
DATA BRANCH PICK bit_src INTO bit_dst
KEYS(SELECT k FROM bit_src ORDER BY k LIMIT1);
Actual result
The literal cases fail consistently:
invalid input: unsupported PK type for engine filter: BOOL
invalid input: unsupported PK type for engine filter: BIT
The corresponding typed-subquery cases succeed and update the expected destination rows.
The result reproduced in 3 out of 3 runs.
Expected result
Literal KEYS(...) should accept values compatible with BOOL and BIT primary keys, consistently with the typed-subquery form.
Code observation
appendNumericStringToVec in pkg/frontend/data_branch_pick.go does not handle BOOL or BIT, while formatPickKeyVectorValueAsString supports these types for the subquery path.
go test ./pkg/frontend \
-run '^(TestAppendNumericStringToVec_AllTypes|TestAppendNumericStringToVec_BitOutOfRange|TestAppendExprToVec_BoolLiteral)$' \
-count=3
go test -race ./pkg/frontend \
-run '^(TestAppendNumericStringToVec_AllTypes|TestAppendNumericStringToVec_BitOutOfRange|TestAppendExprToVec_BoolLiteral)$' \
-count=1
仍未通过的扩展场景
原生 BIT 字面量仍稳定失败:
DATA BRANCH PICK bit8_literal_src
INTO bit8_literal_dst
KEYS(b'00000001');
3/3 次均返回:
ERROR 1690: data out of range: data type bit(8), value '0b00000001'
Activity
fix(frontend): support bool and bit literal pick keys (#26385)
Ariznawlll commentedon Jul 30, 2026
在最新
main上对该问题进行了原始场景复测和扩展覆盖。测试版本
main:ebdc3de0f75f07490c8c85928e622ee309563245b19d5cd50ac20f98f4f588524ae8d1373071e003已通过的场景
BOOL单列主键:KEYS(FALSE)、KEYS(TRUE)KEYS(0)、KEYS(1)BOOL复合主键:(BOOL, INT)tuple keysWHEN CONFLICT FAIL正确返回冲突,目标行保持dst-true,没有部分覆盖WHEN CONFLICT ACCEPT正确将目标行更新为src-trueBIT:BIT(1)的0/1BIT(8)的下界0、中间值127、上界255、DELETE 和不存在 key 的 no-opBIT(64)的0、9223372036854775808、18446744073709551615BIT(8)的256、-1均正确报越界错误新增 BVT 已连续运行 3 轮,每轮
69/69条命令通过:test/distributed/cases/git4data/branch/edge/issue_26074_bool_bit_pick.sql白盒验证也通过:
仍未通过的扩展场景
原生 BIT 字面量仍稳定失败:
DATA BRANCH PICK bit8_literal_src INTO bit8_literal_dst KEYS(b'00000001');3/3 次均返回:
失败后目标表未发生变化。当前实现将 AST 保留的
0b00000001直接交给十进制strconv.ParseUint(..., 10, ...),因此该语法没有被识别。检索现有 issue 未找到重复项;该边界仍属于本 issue 描述的 “BIT literal KEYS” 范围。Unhappy path 覆盖
WHEN CONFLICT FAIL:命中冲突时操作被拒绝,目标表保持原值,没有部分更新。256和-1:均返回范围错误,失败后目标表保持不变。KEYS(b'00000001'):连续 3 次均返回ERROR 1690,说明该 issue 的原生 BIT literal 路径仍未修复。测试结论
测试不通过。
2 remaining items
fix(frontend): support native bit pick keys (#26611)
gouhongshen commentedon Aug 4, 2026
fixed
Ariznawlll commentedon Aug 4, 2026
测试版本
mainc58cd292d3e6e039a8882654d3b20ad345171e87原问题验证
在前次评论中仍失败的原生 BIT 字面量路径已重新验证:
DATA BRANCH PICK ... KEYS(b'00000001')连续执行 3 轮均成功,选中的BIT(8)行从v=10更新为v=110,未选择行保持v=20。Happy Path 覆盖
FALSE/TRUE和0/1。b'00000001'现已连续 3 轮通过。WHEN CONFLICT ACCEPT。Unhappy Path 覆盖
256和-1返回范围错误,失败后目标表保持不变。WHEN CONFLICT FAIL返回冲突,目标行保持原值,没有部分覆盖。白盒验证
执行原生、unary、parenthesized 和 invalid BIT literal 的定向前端测试,连续执行 3 轮通过。
回归测试
test/distributed/cases/git4data/branch/edge/issue_26074_native_bit_pick.sql测试证据
BIT 1 110、BIT 2 20。测试结论
测试通过。
fix(frontend): support bool and bit literal pick keys (matrixorigin#2…
fix(frontend): support native bit pick keys (matrixorigin#26611)
fix(frontend): support bool and bit literal pick keys (matrixorigin#2…
fix(frontend): support native bit pick keys (matrixorigin#26611)
fix(frontend): support bool and bit literal pick keys (matrixorigin#2…
fix(frontend): support native bit pick keys (matrixorigin#26611)