PHP-SQL-Parser
PHP-SQL-Parser copied to clipboard
Allow selection of user-defined variables wihtout space between variable and assignment operator
Given following statement (from the MySQL documentation):
$parser = new PHPSQLParser();
$parsed = $parser->parse('SELECT (@a:=20), @a FROM tbl_name', true);
Expectation is a result with the parsed meta data. Actual result is following exception:
cannot calculate position of := within FROM tbl_name
The problem is that a colon is now allowed right after a user-defined varaible without a space in between (see \PHPSQLParser\positions\PositionCalculator::$allowedOnOperator and /src/PHPSQLParser/positions/PositionCalculator.php:164)