Skip to content

fix(parser): distinguish MySQL constraint and index names - #2534

Open
minleejae wants to merge 1 commit into
JSQLParser:masterfrom
minleejae:fix/mysql-constraint-index-name-1570
Open

fix(parser): distinguish MySQL constraint and index names#2534
minleejae wants to merge 1 commit into
JSQLParser:masterfrom
minleejae:fix/mysql-constraint-index-name-1570

Conversation

@minleejae

Copy link
Copy Markdown
Contributor

Summary

  • distinguish the optional MySQL CONSTRAINT symbol from the optional index name
  • support CONSTRAINT without a symbol and named UNIQUE or FOREIGN KEY indexes
  • preserve getName() for the constraint symbol and expose the index name through getIndexName()
  • retain USING and index comments during deparsing

These cases share the same constraint/index-name ambiguity and are implemented together.

Testing

  • ./gradlew check

Fixes #1570
Fixes #538

AI assistance

OpenAI Codex assisted with the implementation and test coverage. The changes were manually reviewed and verified.

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.

MySQL (optional) Index Names Format create table sql error when encounter unique key with comment

1 participant