mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
mysql sql parser support 'create database if not exists'
This commit is contained in:
@@ -2688,6 +2688,14 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
accept(Token.DATABASE);
|
||||
|
||||
SQLCreateDatabaseStatement stmt = new SQLCreateDatabaseStatement(JdbcConstants.MYSQL);
|
||||
|
||||
if (lexer.token() == Token.IF) {
|
||||
lexer.nextToken();
|
||||
accept(Token.NOT);
|
||||
accept(Token.EXISTS);
|
||||
stmt.setIfNotExists(true);
|
||||
}
|
||||
|
||||
stmt.setName(this.exprParser.name());
|
||||
|
||||
if (lexer.token() == Token.DEFAULT) {
|
||||
|
||||
Reference in New Issue
Block a user