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

Negative numbers prefixed with a space are not parsed correctly #341

Open
ugwind opened this issue Jul 16, 2021 · 0 comments
Open

Negative numbers prefixed with a space are not parsed correctly #341

ugwind opened this issue Jul 16, 2021 · 0 comments

Comments

@ugwind
Copy link

ugwind commented Jul 16, 2021

I believe I have an issue similar to #24 , where the original issue was that statements such as SELECT * FROM table WHERE id IN(0,-1,-2,-3) caused the list of numbers to be parsed as 0,-,1,-,2,-,3 I think the problem is only partly fixed, and a statement such as SELECT * FROM table WHERE id IN(0, -1, -2, -3) (note the spaces) will still exhibit the same issue.

I have been able to address this locally by changing line 127 of PHPSQLLexar.php from

		if (substr($token, -1, 1) === "," || substr($token, -1, 1) === "(") {

to

		if (substr($token, -1, 1) === " " ||  substr($token, -1, 1) === "," || substr($token, -1, 1) === "(") {

but I am not familiar enough with the code to know if this is a viable fix.

@ugwind ugwind changed the title Negative numbers prefixes with a space are not parsed correctly Negative numbers prefixed with a space are not parsed correctly Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant