vikramkakar / php-sql-parser

Automatically exported from code.google.com/p/php-sql-parser
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Parser dies when calculating position of equal followed by a doulbe quote 'column="value"' #70

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. execute this code :

$parser = new PHPSQLParser();
$sql = "select column from table where col="value";
$parser->parse($sql, true);

2.
Script dies with:
PHP Fatal error:  Uncaught exception 'UnableToCalculatePositionException' with 
message 'cannot calculate position of = within  ="value"' in 
php-sql-parser.php:2034

What is the expected output? What do you see instead?
Expected the parser to return an array

What version of the product are you using? On what operating system?
r292 and r300, Ubuntu 12.04

Please provide any additional information below.

It seems it has a problem with equal followed by a double quote, the following 
will work:
 - if you insert a space between the equal and the quote
        col = "value"
        col= "value"
 - replace the double quotes with single ones
        col='value'

Original issue reported on code.google.com by marisr...@gmail.com on 17 Aug 2012 at 8:08

GoogleCodeExporter commented 8 years ago
Checkout REV 301, I have added quotes as valid character around an operator.

Original comment by pho...@gmx.de on 17 Aug 2012 at 8:59

GoogleCodeExporter commented 8 years ago
Tested in r301 and works as expected.

Thank you.

Original comment by marisr...@gmail.com on 17 Aug 2012 at 9:08

GoogleCodeExporter commented 8 years ago
Nice, very short update cycle...

Original comment by pho...@gmx.de on 17 Aug 2012 at 9:23