Skip to content

Commit 76fb13f

Browse files
test: update tests
Signed-off-by: manticore-projects <andreas@manticore-projects.com>
1 parent 0f0922c commit 76fb13f

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

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

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public void execute() throws Throwable {
116116
public void testIssue856() throws JSQLParserException {
117117
String sql = "SELECT "
118118
+ buildRecursiveBracketExpression(
119-
"if(month(today()) = 3, sum(\"Table5\".\"Month 002\"), $1)", "0", 3)
119+
"if(month(today()) = 3, sum(\"Table5\".\"Month 002\"), $1)", "0", 10)
120120
+ " FROM mytbl";
121121
assertSqlCanBeParsedAndDeparsed(sql, true, parser -> parser.withTimeOut(60000));
122122
}
@@ -136,7 +136,26 @@ public void testRecursiveBracketExpressionIssue1019() {
136136
@Test
137137
@Timeout(2000)
138138
public void testRecursiveBracketExpressionIssue1019_2() throws JSQLParserException {
139-
doIncreaseOfParseTimeTesting("IF(1=1, $1, 2)", "1", 10);
139+
doIncreaseOfParseTimeTesting("IF(1=1, $1, 2)", "1", 20);
140+
}
141+
142+
@Test void testIssue2422() throws JSQLParserException {
143+
String sqlStr =
144+
"SELECT\n"
145+
+ "\t\t\t\t ((((position('-' IN (\n"
146+
+ "\t\t\t\t CASE WHEN ((\n"
147+
+ "\t\t\t\t CASE WHEN (5 < 0) THEN\n"
148+
+ "\t\t\t\t 'yes'\n"
149+
+ "\t\t\t\t ELSE\n"
150+
+ "\t\t\t\t 'no'\n"
151+
+ "\t\t\t\t END) = 'yes') THEN\n"
152+
+ "\t\t\t\t SUBSTRING('2012-january-18', (((LENGTH('2012-january-18')) + (5)) + (1)), ABS((0) - (5)))\n"
153+
+ "\t\t\t\t ELSE\n"
154+
+ "\t\t\t\t SUBSTRING('2012-january-18', ((5) + (1)))\n"
155+
+ "\t\t\t\t END)) - 1) + (1)) - (5)) + (0))\n"
156+
+ "\t\t\t\tFROM\n"
157+
+ "\t\t\t\t testtable";
158+
assertSqlCanBeParsedAndDeparsed(sqlStr);
140159
}
141160

142161
@Test

src/test/resources/net/sf/jsqlparser/statement/select/oracle-tests/compound_statements03.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ BEGIN
1717
--@FAILURE: Encountered unexpected token: "BEGIN" "BEGIN" recorded first on May 27, 2022, 10:29:48 PM
1818
--@FAILURE: Encountered unexpected token: ":" ":" recorded first on 9 Dec 2022, 14:03:29
1919
--@FAILURE: Encountered unexpected token: "INTO" "INTO" recorded first on 4 May 2023, 18:47:18
20-
--@FAILURE: Encountered: <K_INTO> / "INTO", at line 12, column 24, in lexical state DEFAULT. recorded first on 15 May 2025, 16:24:08
20+
--@FAILURE: Encountered: <K_INTO> / "INTO", at line 12, column 24, in lexical state DEFAULT. recorded first on 15 May 2025, 16:24:08
21+
--@FAILURE: Encountered: <DOUBLE_COLON> / ":", at line 12, column 29, in lexical state DEFAULT. recorded first on 28 Mar 2026, 16:43:42

0 commit comments

Comments
 (0)