Describe the bug
Using the name costs in the WITH clause throws an exception
To Reproduce
This tests fails.
@Test
public void testGetTableListWithStmtFails() throws Exception {
String sql = "WITH costs AS (SELECT * FROM MY_TABLE1 as ALIAS_TABLE1) SELECT * FROM TESTSTMT";
net.sf.jsqlparser.statement.Statement statement = pm.parse(new StringReader(sql));
Select selectStatement = (Select) statement;
TablesNamesFinder tablesNamesFinder = new TablesNamesFinder();
List<String> tableList = tablesNamesFinder.getTableList(selectStatement);
assertEquals(1, tableList.size());
assertEquals("MY_TABLE1", tableList.get(0));
}
Expected behavior
The test should not fail.
System
- Database you are using: Not relevant.
- Java Version: openjdk version "1.8.0_232"
- JSqlParser version: 4.1
Describe the bug
Using the name
costsin theWITHclause throws an exceptionTo Reproduce
This tests fails.
Expected behavior
The test should not fail.
System