Skip to content

MariaDB: RENAME TABLE is not a supported statement #1253

Closed
@j6f1

Description

@j6f1

RENAME TABLE table TO ... is missing for MariaDB. Unfortunately ALTER TABLE table RENAME TO ... does not work either.

https://mariadb.com/kb/en/rename-table/

Steps to reproduce:

  1. Add SQL script to rename a table. For example, RENAME TABLE IF EXISTS xyz TO zyx;
  2. Parse the SQL... Statements statements = CCJSqlParserUtil.parseStatements(sqlString);

Exception:

Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "RENAME" "RENAME"
    at line 344, column 1.
Was expecting one of:
    "("
    ";"
    "ALTER"
    "BEGIN"
    "CALL"
    "COMMENT"
    "COMMIT"
    "CREATE"
    "DECLARE"
    "DELETE"
    "DESCRIBE"
    "DROP"
    "EXEC"
    "EXECUTE"
    "EXPLAIN"
    "GRANT"
    "INSERT"
    "MERGE"
    "REPLACE"
    "RESET"
    "ROLLBACK"
    "SAVEPOINT"
    "SET"
    "SHOW"
    "TRUNCATE"
    "UPDATE"
    "UPSERT"
    "USE"
    "VALUES"
    "WITH"
    <EOF>
    <K_SELECT>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions