|
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; |
@@ -5243,4 +5244,25 @@ public void testNamedWindowDefinitionIssue1581_2() throws JSQLParserException { |
5243 | 5244 | public void testTimestamptzDateTimeLiteral() throws JSQLParserException { |
5244 | 5245 | assertSqlCanBeParsedAndDeparsed("SELECT * FROM table WHERE x >= TIMESTAMPTZ '2021-07-05 00:00:00+00'"); |
5245 | 5246 | } |
| 5247 | + |
| 5248 | + |
| 5249 | + @Test |
| 5250 | + public void testFunctionComplexExpressionParametersIssue1644() throws JSQLParserException { |
| 5251 | + assertSqlCanBeParsedAndDeparsed("SELECT test(1=1, 'a', 'b')", true); |
| 5252 | + assertSqlCanBeParsedAndDeparsed("SELECT if(instr('avc','a')=0, 'avc', 'aaa')", true); |
| 5253 | + } |
| 5254 | + |
| 5255 | + @Test |
| 5256 | + public void testOracleDBLink() throws JSQLParserException { |
| 5257 | + String sqlStr = "SELECT * from tablename@dblink"; |
| 5258 | + assertSqlCanBeParsedAndDeparsed(sqlStr, true); |
| 5259 | + |
| 5260 | + Select select = (Select) CCJSqlParserUtil.parse(sqlStr); |
| 5261 | + PlainSelect plainSelect = (PlainSelect) select.getSelectBody(); |
| 5262 | + Table table = (Table) plainSelect.getFromItem(); |
| 5263 | + |
| 5264 | + assertNotEquals("tablename@dblink", table.getName()); |
| 5265 | + assertEquals("tablename", table.getName()); |
| 5266 | + assertEquals("dblink", table.getDBLinkName()); |
| 5267 | + } |
5246 | 5268 | } |
0 commit comments