chenster / 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 element of IN clause #52

Closed GoogleCodeExporter closed 8 years ago

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

$sql = "SELECT a FROM b WHERE c IN (1, 2)";
$parser->parse($sql, true);
$p = $parser->parsed;

2. parser dies with this message :

cannot calculate position of 1 within 

What version of the product are you using? On what operating system?

rev 235 on windows 7

Please provide any additional information below.

failing test case :

<?php
require_once(dirname(__FILE__) . '/../../../php-sql-parser.php');
require_once(dirname(__FILE__) . '/../../test-more.php');

$parser = new PHPSQLParser();

$sql = "SELECT a FROM b WHERE c IN (1, 2)";
$parser->parse($sql, true);
$p = $parser->parsed;

$expected = getExpectedValue(dirname(__FILE__), 'issue52.serialized');
eq_array($p, $expected, 'does not die if query contains IN clause');

Original issue reported on code.google.com by nderm...@adequasys.com on 24 Apr 2012 at 10:17

GoogleCodeExporter commented 8 years ago
Please check out the REV 245. Thanks for writing test cases, it simplifies my 
life to copy&paste :-)

Original comment by pho...@gmx.de on 26 Apr 2012 at 12:41

GoogleCodeExporter commented 8 years ago

Original comment by pho...@gmx.de on 30 Apr 2012 at 11:24