improved postgresql parser, fix #4221

This commit is contained in:
高铁
2021-04-02 22:12:53 +08:00
parent 0ae12b9a70
commit 95adaa6086
3 changed files with 11 additions and 0 deletions
@@ -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;