simha95 / 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 CAST expression #51

Closed GoogleCodeExporter closed 8 years ago

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

$sql = "SELECT CAST( 12 AS decimal( 9, 3 ) )";
$parser->parse($sql, true);
$p = $parser->parsed;

2. parser dies with this message :

cannot calculate position of ,  within , 3 ) )

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 CAST( 12 AS decimal( 9, 3 ) )";
$parser->parse($sql, true);
$p = $parser->parsed;

$expected = getExpectedValue(dirname(__FILE__), 'issue51.serialized');
eq_array($p, $expected, 'does not die if query contains cast expression');

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

GoogleCodeExporter commented 8 years ago
Please check out REV 244, it seems to be ok.

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

GoogleCodeExporter commented 8 years ago

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