mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
fix #535
This commit is contained in:
@@ -253,6 +253,10 @@ public class MySqlExprParser extends SQLExprParser {
|
||||
} else if ("COLLATE".equalsIgnoreCase(lexer.stringVal())) {
|
||||
lexer.nextToken();
|
||||
|
||||
if (lexer.token() == Token.EQ) {
|
||||
lexer.nextToken();
|
||||
}
|
||||
|
||||
if (lexer.token() != Token.IDENTIFIER) {
|
||||
throw new ParserException("syntax error");
|
||||
}
|
||||
|
||||
@@ -389,6 +389,11 @@ public class MySqlOutputVisitor extends SQLASTOutputVisitor implements MySqlASTV
|
||||
print(x.getCollate());
|
||||
}
|
||||
}
|
||||
|
||||
if (x.getCollate() != null) {
|
||||
print(" COLLATE ");
|
||||
print(x.getCollate());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -1371,7 +1371,17 @@ public class SQLExprParser extends SQLParser {
|
||||
lexer.nextToken();
|
||||
}
|
||||
}
|
||||
}else if(identifierEquals("COLLATE")){
|
||||
lexer.nextToken();
|
||||
|
||||
if (lexer.token() != Token.IDENTIFIER) {
|
||||
throw new ParserException();
|
||||
}
|
||||
|
||||
charType.setCollate(lexer.stringVal());
|
||||
lexer.nextToken();
|
||||
}
|
||||
|
||||
return charType;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user