Skip to content

[BUG] JSQLParser 5.1 : MySQL : unique index parse fail #2182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ThinkSure opened this issue Mar 7, 2025 · 0 comments
Open

[BUG] JSQLParser 5.1 : MySQL : unique index parse fail #2182

ThinkSure opened this issue Mar 7, 2025 · 0 comments
Labels
DDL DDL statement related MySQL MySQL specific issue Sponsor needed

Comments

@ThinkSure
Copy link

Always check against the Latest SNAPSHOT of JSQLParser and the Syntax Diagram


Failing SQL Feature:

  • mysql unique index parse fail
    
    

SQL Example:

  • Simplified Query Example, focusing on the failing feature
ALTER TABLE `goods` ADD unique `aaa` ( `cate_id` );



Software Information:

  • JSqlParser 5.1
  • MySQL
    

Tips:

When I add a unique index and specify the name of the index, the parsing will report an error.As the following example

ALTER TABLE `goods` ADD unique `aaa` ( `cate_id` );


But if I don't specify the index name, the parsing will be successful.As the following example

ALTER TABLE `goods` ADD unique ( `cate_id` );



@manticore-projects manticore-projects added MySQL MySQL specific issue DDL DDL statement related Sponsor needed labels Mar 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DDL DDL statement related MySQL MySQL specific issue Sponsor needed
Projects
None yet
Development

No branches or pull requests

2 participants