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

Cannot calculate position if there are no space between parentheses and next query part #361

Closed czoIg closed 2 years ago

czoIg commented 2 years ago

The following query produces UnableToCalculatePositionException, although it is a valid sql query:

SELECT IF(status = 1,1,0)FROM users INNER JOIN names ON(users.name = names.name)WHERE(users.id IN(123, 456))AND names.name = "adam"

PositionCalculator::findPositionWithinString() needs to be fixed.