Repository navigation
Description
Is there an existing issue for the same bug?
- I have checked the existing issues.
Branch Name
3.0-dev (the same data branch pick code path should also be checked on main and 4.0-dev)
Commit ID
Other Environment Information
- Hardware parameters:
- OS type:
- Others: Found during review of PR to 3.0: Fix data branch result conversion on 3.0-dev #24876. This issue is intentionally kept separate from that PR, which only fixes decimal result conversion for
data branch diff/save_query_result.
Actual Behavior
data branch pick primary-key handling only covers decimal64 and decimal128 in several shared helper paths. For primary keys whose MatrixOne type is types.T_decimal256 (for example decimal(39,4)), the pick path is incomplete:
extractPKValdecodesT_decimal64andT_decimal128, but notT_decimal256.formatPickKeyVectorValueAsStringformatsT_decimal64andT_decimal128, but notT_decimal256.appendNumericStringToVecparsesT_decimal64andT_decimal128, but notT_decimal256.isNumericTypeexcludesT_decimal256.
As a result, decimal256 primary-key values cannot be reliably parsed, formatted, coerced, filtered, or compared by data branch pick. Depending on the key input path, the operation can reject the key as an unsupported PK type or use an inconsistent representation.
Expected Behavior
data branch pick should support decimal256 primary keys consistently with decimal64 and decimal128:
- literal
KEYS(...)values should parse intoT_decimal256vectors; - subquery key values should format/coerce
T_decimal256values correctly; - picked row primary-key extraction should decode
T_decimal256values correctly; - numeric type checks and conflict matching should include
T_decimal256; - regression tests should cover at least one
decimal(39+) primary keypick case.
Steps to Reproduce
drop database if exists test_pick_decimal256_pk;
create database test_pick_decimal256_pk;
use test_pick_decimal256_pk;
create table t0(
d decimal(39,4) primary key,
v int
);
insert into t0 values (12345678901234567890123456789012345.0001, 1);
data branch create table t1 from t0;
data branch create table t2 from t0;
insert into t2 values (12345678901234567890123456789012346.0002, 2);
-- Expected to pick the decimal256 PK row from t2 into t1.
data branch pick t2 into t1 keys(12345678901234567890123456789012346.0002) when conflict accept;
select * from t1 order by d;Additional information
This is adjacent to the decimal data-branch diff fix, but should be fixed by a separate PR because it touches the pick key parsing/coercion/extraction helpers and needs its own SQL-level regression coverage.
Activity
4.0: Fix data branch decimal results on 4.0-dev (#24895)
Fix data branch decimal results on main (#24894)
Fix data branch decimal results on main (matrixorigin#24894)
Fix data branch decimal results on main (matrixorigin#24894)
Fix data branch decimal results on main (matrixorigin#24894)