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

"WHERE id>1" not parsed correctly #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. parse a query like "SELECT * FROM test WHERE id>1"

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

Expected output is:

[WHERE] => Array ( 
    [0] => Array ( [expr_type] => colref [base_expr] => id [sub_tree] => ) 
    [1] => Array ( [expr_type] => operator [base_expr] => >  [sub_tree] => ) 
    [2] => Array ( [expr_type] => const [base_expr] => 1 [sub_tree] => ) 
) 

Instead we get: 

[WHERE] => Array ( 
    [0] => Array ( [expr_type] => colref [base_expr] => id [sub_tree] => ) 
    [1] => Array ( [expr_type] => colref [base_expr] => >1 [sub_tree] => ) 
)

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

I tested this with revision 36 on linux. Works ok with "WHERE id > 1"

Original issue reported on code.google.com by sophie.s...@gmail.com on 4 Apr 2011 at 12:52

GoogleCodeExporter commented 8 years ago
Thank you for your report.  

Original comment by greenlion@gmail.com on 22 Apr 2011 at 4:29

GoogleCodeExporter commented 8 years ago
This is fixed in my latest SVN checkin.

Added to test to t/gtltop.php 

Original comment by greenlion@gmail.com on 22 Apr 2011 at 5:50

GoogleCodeExporter commented 8 years ago
Thank you

Original comment by sophie.s...@gmail.com on 9 May 2011 at 5:24