bug fixed for postgresql. for issue #2281

This commit is contained in:
wenshao
2018-01-24 21:17:32 +08:00
parent ba13f107c9
commit a7c8c93307
2 changed files with 69 additions and 6 deletions
@@ -88,13 +88,21 @@ public class PGExprParser extends SQLExprParser {
public SQLExpr primary() {
if (lexer.token() == Token.ARRAY) {
SQLArrayExpr array = new SQLArrayExpr();
array.setExpr(new SQLIdentifierExpr(lexer.stringVal()));
String ident = lexer.stringVal();
lexer.nextToken();
accept(Token.LBRACKET);
this.exprList(array.getValues(), array);
accept(Token.RBRACKET);
return primaryRest(array);
if (lexer.token() == Token.LPAREN) {
SQLIdentifierExpr array = new SQLIdentifierExpr(ident);
return this.methodRest(array, true);
} else {
SQLArrayExpr array = new SQLArrayExpr();
array.setExpr(new SQLIdentifierExpr(ident));
accept(Token.LBRACKET);
this.exprList(array.getValues(), array);
accept(Token.RBRACKET);
return primaryRest(array);
}
} else if (lexer.token() == Token.POUND) {
lexer.nextToken();
if (lexer.token() == Token.LBRACE) {