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] 5.4-SNAPSHOT: MySQL numeric column modifiers are inconsistently modeled #2532
MySQL numeric column modifiers SIGNED, UNSIGNED, and ZEROFILL are parsed inconsistently by ColDataType.
SQL examples
CREATETABLEt (
a INT UNSIGNED,
b INT(11) UNSIGNED ZEROFILL,
c DECIMAL(10, 2) SIGNED NOT NULL
);
The same inconsistency is visible when parsing type fragments directly:
INT UNSIGNED
INT(11) UNSIGNED
DECIMAL(10, 2) UNSIGNED
INT UNSIGNED ZEROFILL
Actual behavior
Tested with JSqlParser 5.4-SNAPSHOT at 8397d3a225e3fb380151044add1e4509d01955bf:
INT UNSIGNED is returned as the data type name INT UNSIGNED.
After type arguments, UNSIGNED is left outside ColDataType.
ZEROFILL is also left outside ColDataType.
A complete CREATE TABLE can parse only because these tokens fall through to ColumnDefinition.columnSpecs.
As a result, callers cannot inspect or rewrite these modifiers consistently.
Expected behavior
ColDataType should expose structured signedness and zerofill properties, parse the modifiers consistently with or without type arguments, and deparse without losing tokens. Existing casts such as CAST(value AS UNSIGNED) must remain supported.
OpenAI Codex was used to identify and test the inconsistent parser paths. The reproductions and proposed behavior were manually reviewed against the MySQL documentation.
Activity