The v4.4.0 parser gives incorrect results when a string contains an escaped ' character followed by the -- character sequence later in the string.
With the last two below examples, the where clause does not get parsed.
$parser = new PHPSQLParser();
$parser->parse('update table1 set col1 = \'\\\'\' where col2 = 1'); // works
$parser->parse('update table1 set col1 = \'--\' where col2 = 1'); // works
$parser->parse('update table1 set col1 = \'--\\\'\' where col2 = 1'); // works
$parser->parse('update table1 set col1 = \'\\\'--\' where col2 = 1'); // does not work
$parser->parse('update table1 set col1 = \'a\\\'b--c\' where col2 = 1'); // does not work
The v4.4.0 parser gives incorrect results when a string contains an escaped
'
character followed by the--
character sequence later in the string.With the last two below examples, the where clause does not get parsed.
What happens to the where clause: