mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved sql parser schema repository.
This commit is contained in:
@@ -613,7 +613,24 @@ public class SQLStatementParser extends SQLParser {
|
||||
if (lexer.token() == Token.IDENTIFIED) {
|
||||
lexer.nextToken();
|
||||
accept(Token.BY);
|
||||
stmt.setIdentifiedBy(this.exprParser.expr());
|
||||
|
||||
if (identifierEquals("PASSWORD")) {
|
||||
lexer.nextToken();
|
||||
String password = lexer.stringVal();
|
||||
accept(Token.LITERAL_CHARS);
|
||||
stmt.setIdentifiedByPassword(password);
|
||||
} else {
|
||||
stmt.setIdentifiedBy(this.exprParser.expr());
|
||||
}
|
||||
}
|
||||
|
||||
if (lexer.token() == Token.WITH) {
|
||||
lexer.nextToken();
|
||||
if (lexer.token() == Token.GRANT) {
|
||||
lexer.nextToken();
|
||||
acceptIdentifier("OPTION");
|
||||
stmt.setWithGrantOption(true);
|
||||
}
|
||||
}
|
||||
|
||||
return stmt;
|
||||
@@ -626,6 +643,7 @@ public class SQLStatementParser extends SQLParser {
|
||||
lexer.nextToken();
|
||||
if (identifierEquals("PRIVILEGES")) {
|
||||
privilege = "ALL PRIVILEGES";
|
||||
lexer.nextToken();
|
||||
} else {
|
||||
privilege = "ALL";
|
||||
}
|
||||
@@ -2403,6 +2421,11 @@ public class SQLStatementParser extends SQLParser {
|
||||
protected SQLAlterTableAddIndex parseAlterTableAddIndex() {
|
||||
SQLAlterTableAddIndex item = new SQLAlterTableAddIndex();
|
||||
|
||||
if (identifierEquals("FULLTEXT")) {
|
||||
lexer.nextToken();
|
||||
item.setType("FULLTEXT");
|
||||
}
|
||||
|
||||
if (lexer.token() == Token.UNIQUE) {
|
||||
item.setUnique(true);
|
||||
lexer.nextToken();
|
||||
|
||||
Reference in New Issue
Block a user