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

Working with escaped values #40

Closed
GoogleCodeExporter opened this issue Mar 22, 2016 · 3 comments
Closed

Working with escaped values #40

GoogleCodeExporter opened this issue Mar 22, 2016 · 3 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. The following two queries won't be exploded consistently:

$q1 = "select a from t where x = \"a'b\\cd\" and y = 'ef\"gh'";
$q2 = "select a from t where x = \"abcd\" and y = 'efgh'";

$parser = new CPHPSQLParser();
print_r($parser->parse($q1));
print_r($parser->parse($q2));

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

$q1 and $q2 should have in the [WHERE] part two colref/operator/const parts, 
with only different constant/colref values. Instead, the [WHERE] for q1 has 
only one colref/operator/const part, like this: colref = "x", operator = "=" , 
const "a'b\cd" and y = 'ef"gh'


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

tags/2012-03-23 / win7

Please provide any additional information below.

The parser doesn't correctly handle values with escaped chars inside (no matter 
if the value is single or double quoted inside the query).

Original issue reported on code.google.com by lucian.t...@gmail.com on 30 Mar 2012 at 1:55

@GoogleCodeExporter
Copy link
Author

WTF! :-)

I have changed the handling of backticks and quotes again. Try the current 
version on /trunk. There is a test case with your example, and it seems to 
work, but double check it with some other queries.

Original comment by pho...@gmx.de on 2 Apr 2012 at 7:27

  • Changed state: Started

@GoogleCodeExporter
Copy link
Author

Thanks for the quick reply and the quick fix also :) it works now

Original comment by lucian.t...@gmail.com on 2 Apr 2012 at 8:22

@GoogleCodeExporter
Copy link
Author

Original comment by pho...@gmx.de on 2 Apr 2012 at 8:56

  • Changed state: Fixed

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