mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved mysql parser. bug fixed for issue #2263
This commit is contained in:
@@ -3806,7 +3806,31 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
accept(Token.RPAREN);
|
||||
stmt.addItem(item);
|
||||
} else if (lexer.identifierEquals("EXCHANGE")) {
|
||||
throw new ParserException("TODO " + lexer.info());
|
||||
lexer.nextToken();
|
||||
accept(Token.PARTITION);
|
||||
|
||||
SQLAlterTableExchangePartition item = new SQLAlterTableExchangePartition();
|
||||
|
||||
SQLName partition = this.exprParser.name();
|
||||
item.setPartition(partition);
|
||||
|
||||
accept(Token.WITH);
|
||||
accept(Token.TABLE);
|
||||
SQLName table = this.exprParser.name();
|
||||
item.setTable(table);
|
||||
|
||||
if (lexer.token() == Token.WITH) {
|
||||
lexer.nextToken();
|
||||
acceptIdentifier("VALIDATION");
|
||||
item.setValidation(true);
|
||||
} else if (lexer.identifierEquals(FnvHash.Constants.WITHOUT)) {
|
||||
lexer.nextToken();
|
||||
acceptIdentifier("VALIDATION");
|
||||
item.setValidation(false);
|
||||
}
|
||||
|
||||
|
||||
stmt.addItem(item);
|
||||
} else if (lexer.token() == Token.OPTIMIZE) {
|
||||
lexer.nextToken();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user