Skip to content

[Bug]: DECIMAL ZEROFILL is silently dropped (no zero-pad, DDL loses ZEROFILL+UNSIGNED) #30941

Closed as not planned

Description

@Ariznawlll

Description

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

CREATE TABLE zf (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.

Activity

  1. added
    kind/bug
    on Oct 23, 2026
  2. added this to the MO-202610 milestone on Oct 23, 2026
  3. added theissue type on Oct 23, 2026
  4. XuPeng-SH commented on Oct 24, 2026

    @XuPeng-SH
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bugneeds-triage

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions