mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved sql parser. support drop primary key. for issue #2283
This commit is contained in:
@@ -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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user