Failing SQL feature
MySQL table-level CHECK constraints followed by ENFORCED or NOT ENFORCED cannot be parsed.
SQL example
CREATE TABLE mysql_check_enforcement (
score INT,
CONSTRAINT chk_positive CHECK (score >= 0) ENFORCED,
CONSTRAINT chk_cap CHECK (score < 100) NOT ENFORCED
);
Actual behavior
JSqlParser 5.4-SNAPSHOT at 9a32ff568f580178d9a27b101596aa43eb45d0b7 throws ParseException at the first ENFORCED token. The same failure occurs when only NOT ENFORCED is present.
Expected behavior
The statement should parse as CreateTable, deparse losslessly, and expose the enforcement state on CheckConstraint as a structured enum or nullable Boolean.
Software information and server validation
This is separate from optional constraint/index names tracked in #1570.
AI assistance
OpenAI Codex was used to assemble and execute the parser/server comparison. The case was checked against the MySQL 8.4 documentation and an actual MySQL 8.4.11 server.
Failing SQL feature
MySQL table-level
CHECKconstraints followed byENFORCEDorNOT ENFORCEDcannot be parsed.SQL example
Actual behavior
JSqlParser
5.4-SNAPSHOTat9a32ff568f580178d9a27b101596aa43eb45d0b7throwsParseExceptionat the firstENFORCEDtoken. The same failure occurs when onlyNOT ENFORCEDis present.Expected behavior
The statement should parse as
CreateTable, deparse losslessly, and expose the enforcement state onCheckConstraintas a structured enum or nullable Boolean.Software information and server validation
5.4-SNAPSHOTmysql:8.4)information_schema.TABLE_CONSTRAINTSreportedchk_positiveasENFORCED = YESandchk_capasENFORCED = NO.This is separate from optional constraint/index names tracked in #1570.
AI assistance
OpenAI Codex was used to assemble and execute the parser/server comparison. The case was checked against the MySQL 8.4 documentation and an actual MySQL 8.4.11 server.