mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
fix create table varchar binary bug and binary(10) bug
This commit is contained in:
@@ -849,6 +849,8 @@ public class SQLExprParser extends SQLParser {
|
||||
case OPTIMIZE:
|
||||
case GRANT:
|
||||
case REVOKE:
|
||||
//binary有很多含义,lexer识别了这个token,实际上应该当做普通IDENTIFIER
|
||||
case BINARY:
|
||||
identName = lexer.stringVal();
|
||||
lexer.nextToken();
|
||||
break;
|
||||
@@ -1420,6 +1422,11 @@ public class SQLExprParser extends SQLParser {
|
||||
}
|
||||
|
||||
protected SQLDataType parseCharTypeRest(SQLCharacterDataType charType) {
|
||||
if (lexer.token() == Token.BINARY) {
|
||||
charType.setHasBinary(true);
|
||||
lexer.nextToken();
|
||||
}
|
||||
|
||||
if (identifierEquals("CHARACTER")) {
|
||||
lexer.nextToken();
|
||||
|
||||
@@ -1432,6 +1439,11 @@ public class SQLExprParser extends SQLParser {
|
||||
lexer.nextToken();
|
||||
}
|
||||
|
||||
if (lexer.token() == Token.BINARY) {
|
||||
charType.setHasBinary(true);
|
||||
lexer.nextToken();
|
||||
}
|
||||
|
||||
if (lexer.token() == Token.IDENTIFIER) {
|
||||
if (lexer.stringVal().equalsIgnoreCase("COLLATE")) {
|
||||
lexer.nextToken();
|
||||
|
||||
Reference in New Issue
Block a user