|
46 | 46 | import static org.assertj.core.api.Assertions.assertThat; |
47 | 47 | import static org.junit.jupiter.api.Assertions.assertEquals; |
48 | 48 | import static org.junit.jupiter.api.Assertions.assertFalse; |
| 49 | +import static org.junit.jupiter.api.Assertions.assertNotEquals; |
49 | 50 | import static org.junit.jupiter.api.Assertions.assertNotNull; |
50 | 51 | import static org.junit.jupiter.api.Assertions.assertNull; |
51 | 52 | import static org.junit.jupiter.api.Assertions.assertTrue; |
@@ -5240,4 +5241,25 @@ public void testNamedWindowDefinitionIssue1581_2() throws JSQLParserException { |
5240 | 5241 | public void testTimestamptzDateTimeLiteral() throws JSQLParserException { |
5241 | 5242 | assertSqlCanBeParsedAndDeparsed("SELECT * FROM table WHERE x >= TIMESTAMPTZ '2021-07-05 00:00:00+00'"); |
5242 | 5243 | } |
| 5244 | + |
| 5245 | + |
| 5246 | + @Test |
| 5247 | + public void testFunctionComplexExpressionParametersIssue1644() throws JSQLParserException { |
| 5248 | + assertSqlCanBeParsedAndDeparsed("SELECT test(1=1, 'a', 'b')", true); |
| 5249 | + assertSqlCanBeParsedAndDeparsed("SELECT if(instr('avc','a')=0, 'avc', 'aaa')", true); |
| 5250 | + } |
| 5251 | + |
| 5252 | + @Test |
| 5253 | + public void testOracleDBLink() throws JSQLParserException { |
| 5254 | + String sqlStr = "SELECT * from tablename@dblink"; |
| 5255 | + assertSqlCanBeParsedAndDeparsed(sqlStr, true); |
| 5256 | + |
| 5257 | + Select select = (Select) CCJSqlParserUtil.parse(sqlStr); |
| 5258 | + PlainSelect plainSelect = (PlainSelect) select.getSelectBody(); |
| 5259 | + Table table = (Table) plainSelect.getFromItem(); |
| 5260 | + |
| 5261 | + assertNotEquals("tablename@dblink", table.getName()); |
| 5262 | + assertEquals("tablename", table.getName()); |
| 5263 | + assertEquals("dblink", table.getDBLinkName()); |
| 5264 | + } |
5243 | 5265 | } |
0 commit comments