Skip to content

Commit 9b998d6

Browse files
committed
fixes #909
1 parent 4c4a536 commit 9b998d6

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ Also I would like to know about needed examples or documentation stuff.
7575
* support for table function in **IN** expression
7676
* allow complex expressions within all of a **case when** statement
7777
* support for parameters in **create index** statement
78+
* support for integer parameters for **->>** and **->** JSON expressions
79+
* support for more keywords in following parts of multipart object names (e.g. **mytab.select, mytab.create, ...**)
80+
* support for **OUTER APPLY**
7881

7982
## Extensions of JSqlParser releases
8083

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3084,8 +3084,8 @@ JsonExpression JsonExpression() : {
30843084
}
30853085
{
30863086
column=Column() (
3087-
"->" token=<S_CHAR_LITERAL> {result.addIdent(token.image,"->");} |
3088-
"->>" token=<S_CHAR_LITERAL> {result.addIdent(token.image,"->>");} |
3087+
"->" (token=<S_CHAR_LITERAL> | token=<S_LONG>) {result.addIdent(token.image,"->");} |
3088+
"->>" (token=<S_CHAR_LITERAL> | token=<S_LONG>) {result.addIdent(token.image,"->>");} |
30893089
"#>" token=<S_CHAR_LITERAL> {result.addIdent(token.image,"#>");} |
30903090
"#>>" token=<S_CHAR_LITERAL> {result.addIdent(token.image,"#>>");}
30913091
)+

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2584,6 +2584,11 @@ public void testJsonExpression() throws JSQLParserException {
25842584
assertStatementCanBeDeparsedAs(select, statement, true);
25852585
}
25862586
}
2587+
2588+
@Test
2589+
public void testJsonExpressionWithIntegerParameterIssue909() throws JSQLParserException {
2590+
assertSqlCanBeParsedAndDeparsed("select uc.\"id\", u.nickname, u.avatar, b.title, uc.images, uc.created_at as createdAt from library.ugc_comment uc INNER JOIN library.book b on (uc.books_id ->> 0)::INTEGER = b.\"id\" INNER JOIN library.users u ON uc.user_id = u.user_id where uc.id = 1", true);
2591+
}
25872592

25882593
@Test
25892594
public void testSqlNoCache() throws JSQLParserException {

0 commit comments

Comments
 (0)