Skip to content

[Bug] DATA BRANCH DIFF full-row output fails with 'unsupported mysql type 0' on DECIMAL/vector columns (fixed on main) #24847

Closed

Description

@dengn

Summary

DATA BRANCH DIFF with the default full-row output fails when the table contains a DECIMAL (or vector) column: it raises unsupported mysql type 0 and returns no rows. OUTPUT SUMMARY and COLUMNS(...) (projecting only non-decimal columns) work around it. Appears fixed on main.

Environment

  • Reported on: MatrixOne Cloud free tier, 8.0.30-MatrixOne-v3.0.11
  • Retested on: local Docker matrixorigin/matrixone main branch build, Git commit 0bfda60 (built 2026-05-30), version string 8.0.30-MatrixOne-v

Test case

CREATE DATABASE dtest; USE dtest;
CREATE TABLE t_dec(id INT PRIMARY KEY, name VARCHAR(20), price DECIMAL(10,2));
INSERT INTO t_dec VALUES (1,'A',10.00),(2,'B',20.00),(3,'C',30.00);
DATA BRANCH CREATE TABLE t_dec_br FROM t_dec;
UPDATE t_dec_br SET price=15.00 WHERE id=1;
INSERT INTO t_dec_br VALUES (4,'D',40.00);

-- (1) full-row DIFF over a table with a DECIMAL column
DATA BRANCH DIFF t_dec_br AGAINST t_dec;                 -- v3.0.11: FAILS
-- (2) summary works
DATA BRANCH DIFF t_dec_br AGAINST t_dec OUTPUT SUMMARY;  -- works
-- (3) projecting only non-decimal columns works
DATA BRANCH DIFF t_dec_br AGAINST t_dec COLUMNS (name);  -- works

Actual result

  • v3.0.11 (Cloud) — statement (1) fails:
ERROR 20101 (HY000): internal error: unsupported mysql type 0

(MySQL type 0 = MYSQL_TYPE_DECIMAL; the same happens for tables with a VECF32/vector column.)

  • main (commit 0bfda60) — statement (1) succeeds:
| diff t_dec_br against t_dec | flag   | id   | name | price |
| t_dec_br                    | UPDATE |    1 | A    | 15.00 |
| t_dec_br                    | INSERT |    4 | D    | 40.00 |

Expected

DATA BRANCH DIFF full-row output should serialize DECIMAL (and vector) columns like any other column.

Workaround (for 3.0.11)

Use OUTPUT SUMMARY, or COLUMNS(...) projecting only non-DECIMAL columns. (In the demo we stored prices as INT "cents" to avoid this.)

Version status

  • v3.0.11 (Cloud): reproduces
  • main / 4.0-dev (commit 0bfda60): FIXED (please confirm / add regression test)

Activity

  1. added
    kind/bug
    on Jun 4, 2026
  2. added
    severity/s0
    on Jun 4, 2026
  3. added theissue type on Jun 4, 2026
  4. added this to the MO-202606 milestone on Jun 4, 2026
  5. modified the milestones: MO-202606, MO-202607 on Jun 30, 2026
  6. added
    ai-light
    on Jul 1, 2026
  7. gouhongshen commented on Jul 10, 2026

    @gouhongshen
    Contributor

    修复了

  8. Repository owner unassigned on Jul 13, 2026
  9. Ariznawlll commented on Jul 13, 2026

    @Ariznawlll
    Collaborator

    已在最新 main 上完成验证,并补充 motr 回归测试。

    验证环境

    • MatrixOne:main@52afd25fa63a3cb6037b7bf8ff0bf1328c4793ec
    • motr 用例:issue_24847_data_branch_decimal_diff
    • 回归 PR:matrixorigin/motr#48

    测试过程

    1. 创建包含 DECIMAL(10,2) 列的源表,数据包含正数、负数和 NULL。
    2. 使用 DATA BRANCH CREATE TABLE 创建分支表。
    3. 在分支表中分别执行 DECIMAL UPDATE、INSERT 和 DELETE。
    4. 执行默认 full-row DATA BRANCH DIFF,检查每一行的 flag、主键和 DECIMAL 值。
    5. 再执行 DATA BRANCH DIFF ... OUTPUT SUMMARY,检查 INSERTED、DELETED、UPDATED 数量。

    验证结果

    • full-row diff 正确返回 UPDATE、INSERT、DELETE。
    • 15.00、40.00、-99.99 等 DECIMAL 值均能正确序列化,没有再出现 unsupported mysql type 0。
    • summary 正确统计为 INSERTED=1、DELETED=1、UPDATED=2。
    • 连续执行 5 轮均通过。
    SUMMARY | total=50 success=50 failed=0 skipped=0 | stmts=625 ok=625 fail=0
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ai-lightkind/bugseverity/s0

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions