improved sql parser. support drop primary key. for issue #2283

This commit is contained in:
wenshao
2018-01-26 20:18:00 +08:00
parent fb8dba7520
commit eb8b901fad
4 changed files with 110 additions and 0 deletions
@@ -1661,6 +1661,11 @@ public class OracleStatementParser extends SQLStatementParser {
SQLAlterTableDropIndex item = new SQLAlterTableDropIndex();
item.setIndexName(indexName);
stmt.addItem(item);
} else if (lexer.token() == Token.PRIMARY) {
lexer.nextToken();
accept(Token.KEY);
SQLAlterTableDropPrimaryKey item = new SQLAlterTableDropPrimaryKey();
stmt.addItem(item);
} else {
throw new ParserException("TODO : " + lexer.info());
}
@@ -1406,6 +1406,11 @@ public class SQLStatementParser extends SQLParser {
SQLAlterTableDropIndex item = new SQLAlterTableDropIndex();
item.setIndexName(indexName);
stmt.addItem(item);
} else if (lexer.token() == Token.PRIMARY) {
lexer.nextToken();
accept(Token.KEY);
SQLAlterTableDropPrimaryKey item = new SQLAlterTableDropPrimaryKey();
stmt.addItem(item);
} else {
throw new ParserException("TODO " + lexer.info());
}