mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
bug fixed for pg sql parser. for issue #3091
This commit is contained in:
+8
-1
@@ -455,10 +455,12 @@ public class PGSQLStatementParser extends SQLStatementParser {
|
||||
option = SQLSetStatement.Option.LOCAL;
|
||||
lexer.nextToken();
|
||||
}
|
||||
|
||||
long hash = lexer.hash_lower();
|
||||
String parameter = lexer.stringVal();
|
||||
SQLExpr paramExpr;
|
||||
List<SQLExpr> values = new ArrayList<SQLExpr>();
|
||||
if (TIME.equalsIgnoreCase(parameter)) {
|
||||
if (hash == FnvHash.Constants.TIME) {
|
||||
lexer.nextToken();
|
||||
acceptIdentifier("ZONE");
|
||||
paramExpr = new SQLIdentifierExpr("TIME ZONE");
|
||||
@@ -470,6 +472,11 @@ public class PGSQLStatementParser extends SQLStatementParser {
|
||||
}
|
||||
lexer.nextToken();
|
||||
// return new PGSetStatement(range, TIME_ZONE, exprs);
|
||||
} else if (hash == FnvHash.Constants.ROLE) {
|
||||
paramExpr = new SQLIdentifierExpr(parameter);
|
||||
lexer.nextToken();
|
||||
values.add(this.exprParser.primary());
|
||||
lexer.nextToken();
|
||||
} else {
|
||||
paramExpr = new SQLIdentifierExpr(parameter);
|
||||
lexer.nextToken();
|
||||
|
||||
@@ -384,6 +384,7 @@ public final class FnvHash {
|
||||
long DATE = fnv1a_64_lower("DATE");
|
||||
long DATETIME = fnv1a_64_lower("DATETIME");
|
||||
long TIME = fnv1a_64_lower("TIME");
|
||||
long ROLE = fnv1a_64_lower("ROLE");
|
||||
long TIMESTAMP = fnv1a_64_lower("TIMESTAMP");
|
||||
long CLOB = fnv1a_64_lower("CLOB");
|
||||
long NCLOB = fnv1a_64_lower("NCLOB");
|
||||
|
||||
Reference in New Issue
Block a user