mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
mysql sql parser 'create database' support charset/collate
This commit is contained in:
@@ -2705,6 +2705,21 @@ public class MySqlStatementParser extends SQLStatementParser {
|
||||
if (lexer.token() == Token.HINT) {
|
||||
stmt.setHints(this.exprParser.parseHints());
|
||||
}
|
||||
|
||||
if (identifierEquals("CHARACTER")) {
|
||||
lexer.nextToken();
|
||||
accept(Token.SET);
|
||||
String charset = lexer.stringVal();
|
||||
accept(Token.IDENTIFIER);
|
||||
stmt.setCharacterSet(charset);
|
||||
}
|
||||
|
||||
if (identifierEquals("COLLATE")) {
|
||||
lexer.nextToken();
|
||||
String collate = lexer.stringVal();
|
||||
accept(Token.IDENTIFIER);
|
||||
stmt.setCollate(collate);
|
||||
}
|
||||
|
||||
return stmt;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user