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
601 stars 156 forks source link

Handle comments in FromBuilder #379

Open stollr opened 8 months ago

stollr commented 8 months ago

The following SQL query could be parsed:

SELECT * FROM car /* test comment */ WHERE color = 'black'

but the creator was not able to generate a SQL query from the parsed tree. An UnableToCreateSQLException with the message unknown [expr_type] = comment in "FROM" [0] was thrown in src/PHPSQLParser/builders/FromBuilder.php in line 103.