Closed
Description
TablesNamesFinder.getTables misses table when using same alias as table name
SQL Example
SELECT * FROM (SELECT * FROM A) AS A
JOIN B ON A.a = B.a
JOIN C ON A.a = C.a
new TablesNamesFinder().getTables(sql) returns Set("B", "C") but should return Set("A", "B", "C")
It works fine on version 4.8 but not on 5.0
Also, if the alias is not the same as the table_name (i.e. (SELECT * FROM A) AS A1) then it does work fine and returns Set("A", "B", "C")
Additional context
- JSQLParser 5.0 (works fine on 4.8)