improved postgresql parser. for issue #2129

This commit is contained in:
wenshao
2017-11-25 21:21:02 +08:00
parent 128ddafacf
commit b90e175aa3
7 changed files with 60 additions and 7 deletions
@@ -2431,10 +2431,14 @@ public class SQLExprParser extends SQLParser {
if (lexer.identifierEquals(FnvHash.Constants.COLLATE)) {
lexer.nextToken();
if (lexer.token != Token.IDENTIFIER) {
if (lexer.token == Token.LITERAL_ALIAS) {
charType.setCollate(lexer.stringVal());
} else if (lexer.token == Token.IDENTIFIER) {
charType.setCollate(lexer.stringVal());
} else {
throw new ParserException();
}
charType.setCollate(lexer.stringVal());
lexer.nextToken();
}