Skip to content

[BUG] JSQLParser Version: 5.0 RDBMS: ANY, TablesNamesFinder.getTables missing table when using same alias #2035

Closed
@oscarbonilla-tid

Description

@oscarbonilla-tid

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)

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions