File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
main/jjtree/net/sf/jsqlparser/parser
test/java/net/sf/jsqlparser/statement/select Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -3281,6 +3281,7 @@ Expression PrimaryExpression() #PrimaryExpression:
32813281 boolean exclamationMarkNot = false;
32823282 boolean dateExpressionAllowed = true;
32833283 Expression idxExpr;
3284+ ExpressionList list;
32843285}
32853286{
32863287 [ <K_NOT> { not=true; } | "!" { not=true; exclamationMarkNot=true; } ]
@@ -3341,7 +3342,14 @@ Expression PrimaryExpression() #PrimaryExpression:
33413342
33423343 | LOOKAHEAD("(" retval=SubSelect() ")") "(" retval=SubSelect() ")"
33433344
3344- | "(" retval=SimpleExpression() ")" {retval = new Parenthesis(retval); }
3345+ | "(" list = SimpleExpressionList() ")"
3346+ {
3347+ if (list.getExpressions().size() == 1) {
3348+ retval = new Parenthesis(list.getExpressions().get(0));
3349+ } else {
3350+ retval = new RowConstructor().withExprList(list);
3351+ }
3352+ }
33453353 )
33463354
33473355 [
Original file line number Diff line number Diff line change @@ -4441,4 +4441,9 @@ public void testSignedKeywordIssue1100() throws JSQLParserException {
44414441 public void testSignedKeywordIssue995 () throws JSQLParserException {
44424442 assertSqlCanBeParsedAndDeparsed ("SELECT leading FROM prd_reprint" );
44434443 }
4444+
4445+ @ Test
4446+ public void testSelectTuple () throws JSQLParserException {
4447+ assertSqlCanBeParsedAndDeparsed ("SELECT hyperloglog_distinct((1, 2)) FROM t" );
4448+ }
44444449}
You can’t perform that action at this time.
0 commit comments