Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parser dies when calculating position of _utf8 #50

Open
GoogleCodeExporter opened this issue Jun 17, 2015 · 3 comments
Open

parser dies when calculating position of _utf8 #50

GoogleCodeExporter opened this issue Jun 17, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. execute this code :

$parser = new PHPSQLParser();

$sql = "SELECT _utf8'hi'";
$parser->parse($sql, true);

2. script dies with this message :

cannot calculate position of _utf8 within  _utf8'hi'


What is the expected output? What do you see instead?

Expected the parser to return an array with one element in the SELECT array.

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 _utf8'hi'";
$parser->parse($sql, true);
$p = $parser->parsed;

$expected = getExpectedValue(dirname(__FILE__), 'issue50.serialized');
eq_array($p, $expected, 'does not die if query contains _utf8 construct');

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant