andialbrecht / sqlparse

A non-validating SQL parser module for Python
BSD 3-Clause "New" or "Revised" License
3.73k stars 695 forks source link

Cannot parse FROM( #382

Open GabrielDrapor opened 6 years ago

GabrielDrapor commented 6 years ago

When facing the following situation, sqlparse.parse() doesn't work well:

SELECT xxx
FROM(
xxxxx
)t1
INNER JOIN
(
xxxx
) t2
ON t1.xxx = t2.xxx 
FROM(
xxxxx
)t1

will be parsed as an entire IdentifierList but not a KeyWord and a IdentifierList

fredyw commented 5 years ago

It maybe be related to https://github.com/andialbrecht/sqlparse/issues/446.