mnpenner / 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

Position calculation fails without space between quote and token #137

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
try to parse this query with position calculation:
select`title`from`table`

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

Please provide any additional information below.
It seams to be ok for mysql if you have no space between SELECT and quote "`"

Original issue reported on code.google.com by h.leith...@gmail.com on 30 Apr 2014 at 9:12

GoogleCodeExporter commented 9 years ago
hm, this seems to be a bigger problem. The position calculator can handle that, 
if you change the allowed characters for word borders. But the lexer will have 
problems to split the tokens. There can be also some side-effects on parser 
routines, which wait for empty tokens after a trim(), which will remove the 
whitespace. This major problem prevents also the parsing of _utf8'haha'. I have 
no simple solution for that.

Original comment by pho...@gmx.de on 28 May 2014 at 3:49

GoogleCodeExporter commented 9 years ago
I have added some code to the PositionCalculator, but I'm not sure, whether or 
not the parser will work in all such cases. See r1363.

Original comment by pho...@gmx.de on 28 May 2014 at 4:12

GoogleCodeExporter commented 9 years ago

Original comment by pho...@gmx.de on 3 Jun 2014 at 7:55