Failing SQL feature
MySQL numeric column modifiers SIGNED, UNSIGNED, and ZEROFILL are parsed inconsistently by ColDataType.
SQL examples
CREATE TABLE t (
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.
Software information
AI assistance
OpenAI Codex was used to identify and test the inconsistent parser paths. The reproductions and proposed behavior were manually reviewed against the MySQL documentation.
Failing SQL feature
MySQL numeric column modifiers
SIGNED,UNSIGNED, andZEROFILLare parsed inconsistently byColDataType.SQL examples
The same inconsistency is visible when parsing type fragments directly:
Actual behavior
Tested with JSqlParser
5.4-SNAPSHOTat8397d3a225e3fb380151044add1e4509d01955bf:INT UNSIGNEDis returned as the data type nameINT UNSIGNED.UNSIGNEDis left outsideColDataType.ZEROFILLis also left outsideColDataType.CREATE TABLEcan parse only because these tokens fall through toColumnDefinition.columnSpecs.As a result, callers cannot inspect or rewrite these modifiers consistently.
Expected behavior
ColDataTypeshould expose structured signedness and zerofill properties, parse the modifiers consistently with or without type arguments, and deparse without losing tokens. Existing casts such asCAST(value AS UNSIGNED)must remain supported.Software information
5.4-SNAPSHOTAI assistance
OpenAI Codex was used to identify and test the inconsistent parser paths. The reproductions and proposed behavior were manually reviewed against the MySQL documentation.