Skip to content

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

Description

@ThinkSure

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



Activity

  1. jxnu-liguobin commented on Sep 24, 2025

    @jxnu-liguobin
    Contributor

    The requirement seems simple? I haven't been here for a long time, 😄 I'm going to take a look, and anyone can pick it up in front of me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions