Repository navigation
Description
Bug or Feature Request
Bug
Description
mo-dump exports computed values of generated columns in the INSERT statements of its SQL dumps — producing backup files that cannot be restored into MatrixOne itself. The replay fails with:
ERROR 20301 (HY000): invalid input: the value specified for generated column 'b' in table 'g' is not allowed
Both STORED and VIRTUAL generated columns are affected. MatrixOne (like MySQL) rejects explicit values for generated columns, and mo-dump's own output violates that rule — a self-inconsistency where the tool's "MODUMP SUCCESS" output is unreplayable on the same server, same schema, same data.
Since dump files start with DROP DATABASE IF EXISTS ..., a failed replay leaves the target database partially restored (schema + earlier tables exist, the offending table is dropped or empty) — the familiar silent-data-loss blast radius of the dump-fidelity family.
Minimal end-to-end repro (100% deterministic):
CREATE DATABASE gen;
CREATE TABLE gen.g (
id INT PRIMARY KEY,
a INT,
b INT GENERATED ALWAYS AS (a*2) STORED,
c INT GENERATED ALWAYS AS (a+b) VIRTUAL
);
INSERT INTO gen.g (id, a) VALUES (1,5), (2,7);$ ./mo-dump -h ... -P 16001 -u root -p *** -db gen > gen.sql
# (exit 0; file ends with "MODUMP SUCCESS"; DDL part is perfect, including
# `b` int GENERATED ALWAYS AS ((a * 2)) STORED / `c` ... VIRTUAL)
$ grep "INSERT INTO \`g\`" gen.sql
INSERT INTO `g` VALUES (2,7,14,21),(1,10,20,30);
# ^^^^^^^^^^^ generated columns b,c included as literals!
$ mysql -h ... < gen.sql
ERROR 20301 (HY000) at line 29: invalid input: the value specified for generated column 'b' in table 'g' is not allowedThe table itself refuses what the dumper wrote: INSERT INTO g VALUES (1,5,10,15) directly → same error (positive control that this is the server's intentional semantics, aligned with MySQL).
Expected behavior
mysqldump emits INSERTs listing only non-generated columns for such tables (e.g. INSERT INTO g (id,a) VALUES ...), which replays cleanly and lets the engine recompute b/c. mo-dump should do the same (column-listed INSERT excluding generated columns). An engine-side alternative (accept-and-recompute instead of reject) would diverge from MySQL semantics and is not recommended.
Versions
- mo-dump:
matrixorigin/mo_dump@324c33d(origin/main HEAD, 2026-10-20) - MatrixOne: commit
b24d1b3(2026-10-16), v3.x dev, macOS arm64
Additional context
- Dump-fidelity family: [Bug]: mo-dump hangs forever (100% CPU in adjustViewOrder) when view DDL text false-matches another view's name — substring dependency graph builds fake cycles with no guard; truncated dump still replays DROP DATABASE #30672 (view substring fake-cycle hang), [Bug]: mo-dump SQL backups must be restorable, consistent, and preserve exact values #30673 (raw NUL bytes), [Bug]: utf8mb4_general_ci / utf8mb4_0900_ai_ci are fake case-insensitive #30680-adjacent (COLLATE attribute loss in SHOW CREATE), [Bug]: SHOW CREATE TABLE and mo-dump must preserve AUTO_INCREMENT allocation state #30666 (AUTO_INCREMENT seed loss) — in this family, this bug is arguably the most severe per-occurrence: any database containing one generated column produces an unrestorable backup while every observable signal (exit code, SUCCESS comment) says success.
- CHECK constraints and both storage modes of generated columns are dumped correctly in DDL (verified) — only the INSERT data path is broken.
Activity
XuPeng-SH commentedon Oct 22, 2026
This report is now tracked together with #30673. The canonical issue retains explicit acceptance cases for the behavior described here. This is an administrative duplicate/consolidation closure only; the underlying defect is not claimed fixed. The original description and discussion remain available on this issue.