Skip to content

Commit a0665a2

Browse files
committed
Add support for AllTableColumns in primary expression
1 parent 1668528 commit a0665a2

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/main/jjtree/net/sf/jsqlparser/parser/JSqlParserCC.jjt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5301,6 +5301,7 @@ Expression PrimaryExpression() #PrimaryExpression:
53015301

53025302
| LOOKAHEAD(2, {!interrupted}) retval=CastExpression()
53035303

5304+
| LOOKAHEAD(AllTableColumns()) retval=AllTableColumns()
53045305

53055306
// support timestamp expressions
53065307
| LOOKAHEAD(2, {!interrupted}) (token=<K_TIME_KEY_EXPR> | token=<K_CURRENT>) { retval = new TimeKeyExpression(token.image); }

src/test/java/net/sf/jsqlparser/statement/select/SelectTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5486,6 +5486,12 @@ public void testReservedKeywordsIssue1352() throws JSQLParserException {
54865486
assertSqlCanBeParsedAndDeparsed("SELECT fulltext from fulltext.fulltext", true);
54875487
}
54885488

5489+
@Test
5490+
public void testGroupByWithAllTableColumns() throws JSQLParserException {
5491+
assertSqlCanBeParsedAndDeparsed(
5492+
"select c.post_id, p.* from posts p inner join comments c on c.post_id = p.post_id group by p.post_id, c.post_id, p.*;");
5493+
}
5494+
54895495
@Test
54905496
public void testTableSpaceKeyword() throws JSQLParserException {
54915497
// without extra brackets

0 commit comments

Comments
 (0)