Skip to content

Accept SQL Server CREATE TABLE trailing commas with shared element parsing - #2603

Merged
manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:fix/sqlserver-create-table-trailing-comma
Sep 11, 2026
Merged

manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:fix/sqlserver-create-table-trailing-comma

Conversation

@minleejae

Copy link
Copy Markdown
Contributor

SQL Server CREATE TABLE film_text (..., PRIMARY KEY NONCLUSTERED (film_id),) fails on its final comma. Accept one trailing separator with Dialect.SQLSERVER, preserving the ordered table elements and normalizing the comma away when rendering SQL.

Extract the repeated column/constraint/LIKE choice into one table-element production and remove unused intermediate lists. Other dialects and function return-table definitions retain their existing separator rules.

Validation: full Gradle check, focused dialect/malformed-input/AST/round-trip regressions, and the updated usage-page Sphinx build passed. The original Sakila schema now parses and round-trips as 70 statements.

Refs #1563; this covers the schema separator gap.

Syntax: Microsoft ScriptDom CREATE TABLE grammar.

@minleejae
minleejae force-pushed the fix/sqlserver-create-table-trailing-comma branch from 4eaa336 to 143d161 Compare September 11, 2026 15:49
@manticore-projects
manticore-projects merged commit 179ee11 into JSQLParser:master Sep 11, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants