greenlion / PHP-SQL-Parser

A pure PHP SQL (non validating) parser w/ focus on MySQL dialect of SQL
BSD 3-Clause "New" or "Revised" License
607 stars 156 forks source link

Fix subselect starting with comment #290

Closed shokre closed 5 years ago

shokre commented 6 years ago

When sub select starts with a comment tree is not properly parsed.

For instance

SELECT (-- comment
select colA FRom TableA) as b From test t

parses subselect as bracket_expression instead of sub_query

Added test case