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 DIFF fails on JSON, BIT and BLOB when saving query results #31534
DATA BRANCH DIFF fails when save_query_result is enabled and the changed row contains a JSON, BIT, or binary BLOB column. The same diff returns the correct changed row when result saving is disabled. The error prevents inspecting branch changes; the source and branch remain unchanged.
CREATEDATABASEbranch_json_repro;
USE branch_json_repro;
CREATETABLEbase (id INTPRIMARY KEY, value JSON);
INSERT INTO base VALUES (1, '{"a":1}');
DATA BRANCH CREATE TABLE child FROM base;
UPDATE child SET value ='{"a":2}'WHERE id =1;
SET save_query_result = OFF;
DATA BRANCH DIFF child AGAINST base;
-- child, UPDATE, 1, {"a": 2}SET save_query_result =ON;
DATA BRANCH DIFF child AGAINST base;
-- ERROR 20101: internal error: unsupported mysql type 245
DATA BRANCH DIFF child AGAINST base OUTPUT COUNT; -- 1SELECT1; -- succeeds
The same steps with value BIT(64) (b'1' → b'0') fail with unsupported mysql type 16; with value BLOB (X'00' → X'FF') they fail with unsupported mysql type 252.
Expected
Enabling result saving should not prevent a supported diff from returning or saving the changed rows. The saved result should preserve the original values and types.
Validation
Reproduced 3/3 in freshly created databases (qbranchmatrix_04, _05, _06). In every round JSON, BIT and BLOB returned their expected updated values with saving OFF and the listed errors with saving ON; OUTPUT COUNT returned 1 and the session remained usable. UUID, VECF32, VARBINARY, DECIMAL, TIMESTAMP and ENUM controls succeeded with saving ON. A separate mixed-type run confirmed OUTPUT AS and the source/branch data were unaffected. Only the standalone setup was tested.
Code analysis
satisfyDiffOutputOpt passes the diff result to trySaveQueryResult. mysqlColDef2PlanResultColDef lacks mappings for JSON, BIT and binary BLOB wire types and returns the observed error. This missing mapping is distinct from #31498's unsigned-value type assertion panic.
Activity
fix(frontend): honor column signedness when saving query results (#31498
fix(frontend): preserve bytes and binary types in saved query results (…