mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved postgresql parser, fix #4221
This commit is contained in:
@@ -1584,6 +1584,9 @@ public class SQLExprParser extends SQLParser {
|
||||
aggregateExpr.setOption(SQLAggregateOption.DISTINCT);
|
||||
}
|
||||
|
||||
if (lexer.token == Token.COLONCOLON) {
|
||||
return primaryRest(aggregateExpr);
|
||||
}
|
||||
|
||||
return aggregateExpr;
|
||||
}
|
||||
|
||||
@@ -80,6 +80,10 @@ public class PostgresqlResourceTest extends PGTest {
|
||||
exec_test("bvt/parser/postgresql-10.txt");
|
||||
}
|
||||
|
||||
public void test_11() throws Exception {
|
||||
exec_test("bvt/parser/postgresql-11.txt");
|
||||
}
|
||||
|
||||
public void exec_test(String resource) throws Exception {
|
||||
System.out.println(resource);
|
||||
InputStream is = null;
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
select v_date_desc::date - max(access_time)::date from table1;
|
||||
---------------------------
|
||||
SELECT v_date_desc::date - max(access_time)::date
|
||||
FROM table1;
|
||||
Reference in New Issue
Block a user