sanjosh / 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 calulation fails on multi column select with break #60

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. run test.php

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

Please provide any additional information below.
If you remove the ", password" part it works fine.

Original issue reported on code.google.com by h.leith...@gmail.com on 29 May 2012 at 3:16

Attachments:

GoogleCodeExporter commented 8 years ago
THis is not a problem of the position calculator, it is a problem of the 
parsing algorithm. "password" is a reserved keyword, so the parser doesn't 
interpret it as column. If you parse the statement without position calculation 
and print the result, you will see a very strange result set.

Original comment by pho...@gmx.de on 1 Jun 2012 at 6:07

GoogleCodeExporter commented 8 years ago
I have added some code to prevent PASSWORD as extra keyword, if it doesn't 
follow after a SET statement. But PASSWORD is also a function and the parser 
has no chance to differ between function and column. So the resultset is wrong 
on that point.

Check out REV 284.

Original comment by pho...@gmx.de on 1 Jun 2012 at 6:35

GoogleCodeExporter commented 8 years ago
Maybe I can split the function array into functions with/without parameters. So 
I can look forward, if there are some parameters and differ between a simple 
colref and a function. This will not work on functions like NOW without 
parenthesis. But it help in some other cases.

Original comment by pho...@gmx.de on 1 Jun 2012 at 6:40

GoogleCodeExporter commented 8 years ago
Check out r345, if have added some code to handle that issue. There are some 
tests, which runs fine.

Original comment by pho...@gmx.de on 30 Aug 2012 at 8:01

GoogleCodeExporter commented 8 years ago

Original comment by pho...@gmx.de on 1 Nov 2013 at 11:08