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]: DECIMAL ZEROFILL is silently dropped (no zero-pad, DDL loses ZEROFILL+UNSIGNED) #30941
DECIMAL ZEROFILL is silently dropped. A DECIMAL(10,2) ZEROFILL column stores and displays the value without zero-padding, and SHOW CREATE TABLE loses both ZEROFILL and the implicit UNSIGNED it implies. MySQL zero-pads the value to the declared width and preserves UNSIGNED ZEROFILL in DDL.
Environment
MatrixOne dev build 3a1e42b430, server reports 8.0.30-MatrixOne-v1.3.0
MySQL comparison: 8.0.45 (localhost)
Reproduction
CREATETABLEzf (x DECIMAL(10,2) ZEROFILL);
INSERT INTO zf VALUES (123.45);
SELECT x FROM zf;
-- MatrixOne: 123.45-- MySQL: 00000123.45 (zero-padded to width 10)
SHOW CREATE TABLE zf;
-- MatrixOne: `x` decimal(10,2) DEFAULT NULL-- MySQL: `x` decimal(10,2) unsigned zerofill DEFAULT NULL
Root cause
The ZEROFILL attribute is parsed and then discarded — it is neither stored in the column metadata nor applied at display time. ZEROFILL in MySQL also implies UNSIGNED (a zero-filled value can't be negative), and both attributes are lost here. This is the same "column modifier silently ignored" family as #30940 (DECIMAL UNSIGNED), but with the additional metadata-loss symptom (DDL round-trip drops the attributes).
Impact
Schema migration asymmetry: SHOW CREATE TABLE / mysqldump from MatrixOne loses ZEROFILL (and its implied UNSIGNED), so a re-created table on either engine no longer matches the original.
Display contracts that rely on fixed-width zero-padded numbers (e.g. invoice IDs, account numbers) render differently.
Expected behavior
Either implement ZEROFILL (zero-pad display + implied UNSIGNED, matching MySQL), or — if unsupported — reject ZEROFILL at DDL time rather than silently dropping the modifier and losing the metadata.
Tracking consolidated into #30940. The canonical issue now includes this report's independent scope and acceptance criteria. This is administrative consolidation, not a claim that the defect is fixed; the original reproduction and discussion are preserved here.
Activity
XuPeng-SH commentedon Oct 24, 2026
Tracking consolidated into #30940. The canonical issue now includes this report's independent scope and acceptance criteria. This is administrative consolidation, not a claim that the defect is fixed; the original reproduction and discussion are preserved here.