JSqlParser icon indicating copy to clipboard operation
JSqlParser copied to clipboard

ParseException: Encountered unexpected token: "EXCHANGE"

Open proteen opened this issue 3 years ago • 1 comments

sql

alter table total_issue_info exchange partition P0001 with table total_issue_info_tmp

Expected Behavior

the sql runs well on Navicat, I expect jsqlparser parses it also well

Actual Behavior

net.sf.jsqlparser.JSQLParserException at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:51) at net.sf.jsqlparser.parser.CCJSqlParserUtil.parse(CCJSqlParserUtil.java:40) at com.spy.service.situation.SituationHandler.handle(SituationHandler.java:654) Caused by: net.sf.jsqlparser.parser.ParseException: Encountered unexpected token: "exchange" <S_IDENTIFIER> at line 1, column 34.

Was expecting one of:

"ADD"
"ALGORITHM"
"ALTER"
"CHANGE"
"DROP"
"MODIFY"

at net.sf.jsqlparser.parser.CCJSqlParser.generateParseException(CCJSqlParser.java:22439)

System

  • Database :5.7
  • Java Version :1.8
  • JSqlParser version:4.0

proteen avatar Jan 09 '22 13:01 proteen

Confirmed,

the exchange partition ... with table ... clause of the alter table statement is not supported. Oracle supports it: https://docs.oracle.com/database/121/VLDBG/GUID-09CE9F52-A5BE-4CFD-8164-867CAF96DDCF.htm

manticore-projects avatar Jan 09 '22 13:01 manticore-projects

See UnsupportedStatements as explain in #1945 (unless you will sponsor or provide a specific implementation of this feature.)

manticore-projects avatar Apr 18 '24 12:04 manticore-projects