File tree Expand file tree Collapse file tree 2 files changed +6
-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 +6
-1
lines changed Original file line number Diff line number Diff line change @@ -3102,7 +3102,7 @@ IntervalExpression IntervalExpression() : {
31023102{
31033103
31043104{ interval = new IntervalExpression(); }
3105- <K_INTERVAL> ["-" {signed=true;}] (token=<S_LONG> | token=<S_DOUBLE> | token=<S_CHAR_LITERAL> | expr = Column ())
3105+ <K_INTERVAL> ["-" {signed=true;}] (token=<S_LONG> | token=<S_DOUBLE> | token=<S_CHAR_LITERAL> | expr = SimpleExpression ())
31063106 {
31073107 if (expr != null) {
31083108 if (signed) expr = new SignedExpression('-', expr);
Original file line number Diff line number Diff line change @@ -1322,6 +1322,11 @@ public void testIssue862CaseWhenConcat() throws JSQLParserException {
13221322 assertSqlCanBeParsedAndDeparsed ("SELECT c1, CASE c1 || c2 WHEN '091' THEN '2' ELSE '1' END AS c11 FROM T2" );
13231323 }
13241324
1325+ @ Test
1326+ public void testExpressionsInIntervalExpression () throws JSQLParserException {
1327+ assertSqlCanBeParsedAndDeparsed ("SELECT DATE_SUB(mydate, INTERVAL DAY(anotherdate) - 1 DAY) FROM tbl" );
1328+ }
1329+
13251330 @ Test
13261331 public void testReplaceAsFunction () throws JSQLParserException {
13271332 String statement = "SELECT REPLACE(a, 'b', c) FROM tab1" ;
You can’t perform that action at this time.
0 commit comments