Skip to content

[BUG] 4.7: MySQL : Alter Add Key Encountered unexpected token: "comment" "COMMENT" #1906

Closed
@linux2014linux

Description

@linux2014linux

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

Failing SQL Feature:

  net.sf.jsqlparser.JSQLParserException: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "comment" "COMMENT"
    at line 1, column 51.

Was expecting one of:

    ","
    "DEFERRABLE"
    "DISABLE"
    "ENABLE"
    "NOT"
    "NOVALIDATE"
    "USING"
    "VALIDATE"
    <EOF>
    <ST_SEMICOLON>


	at net.sf.jsqlparser.parser.CCJSqlParserUtil.parseStatement(CCJSqlParserUtil.java:315)
	at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:116)
	at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:85)
	at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:62)

SQL Example:

    alter table `student` add key `idx_name` (`name`) comment 'index name';

Software Information:

  • JSqlParser version 4.7
  • MySQL

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