-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Description
Describe the bug
JSqlParser doesn't support LOCK TABLES
and throws ParseException: Encountered unexpected token
.
To Reproduce
SQL:
-- Other Parsable Statements;
LOCK TABLES `table` WRITE;
-- Other Parsable Statements;
-- UNLOCK...
Parsing:
val file = File(path).bufferedReader()
val parser = CCJSqlParser(file.readText())
Exception:
Exception in thread "main" net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "LOCK" <S_IDENTIFIER>
at line 42, column 1.
Was expecting one of:
"("
";"
"ALTER"
"BEGIN"
"CALL"
"COMMENT"
"COMMIT"
"CREATE"
"DECLARE"
"DELETE"
"DESCRIBE"
"DROP"
"EXEC"
"EXECUTE"
"EXPLAIN"
"GRANT"
"INSERT"
"MERGE"
"REPLACE"
"SET"
"SHOW"
"TRUNCATE"
"UPDATE"
"UPSERT"
"USE"
"VALUES"
"WITH"
<K_SELECT>
at net.sf.jsqlparser.parser.CCJSqlParser.generateParseException(CCJSqlParser.java:26538)
at net.sf.jsqlparser.parser.CCJSqlParser.jj_consume_token(CCJSqlParser.java:26377)
at net.sf.jsqlparser.parser.CCJSqlParser.Statements(CCJSqlParser.java:511)
Expected behavior
Parse it into an AST.
System
Ref: https://dev.mysql.com/doc/refman/8.0/en/lock-tables.html
Metadata
Metadata
Assignees
Labels
No labels