Skip to content

Commit 32c4d8a

Browse files
committed
fixes #614
1 parent 094cc80 commit 32c4d8a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2504,13 +2504,13 @@ Expression PrimaryExpression() #PrimaryExpression:
25042504
| retval = IntervalExpression()
25052505
)
25062506

2507-
[ "::" type=ColDataType() {
2507+
( "::" type=ColDataType() {
25082508
castExpr = new CastExpression();
25092509
castExpr.setUseCastKeyword(false);
25102510
castExpr.setLeftExpression(retval);
25112511
castExpr.setType(type);
25122512
retval=castExpr;
2513-
} ]
2513+
} )*
25142514

25152515
{
25162516
if (sign != null) {

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3161,4 +3161,9 @@ public void testProblemSqlFuncParamIssue605_2() throws JSQLParserException {
31613161
public void testSqlContainIsNullFunctionShouldBeParsed() throws JSQLParserException {
31623162
assertSqlCanBeParsedAndDeparsed("SELECT name, age, ISNULL(home, 'earn more money') FROM person");
31633163
}
3164+
3165+
@Test
3166+
public void testNestedCast() throws JSQLParserException {
3167+
assertSqlCanBeParsedAndDeparsed("SELECT acolumn::bit (64)::bigint FROM mytable");
3168+
}
31643169
}

0 commit comments

Comments
 (0)