JSqlParser icon indicating copy to clipboard operation
JSqlParser copied to clipboard

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

Open ThinkSure opened this issue 8 months ago • 0 comments

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` );



ThinkSure avatar Mar 07 '25 05:03 ThinkSure