rickywu-posh / 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

Select parser problem with quote #4

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. use the parser to parse a query like Select table.`field` from table 
2.
3.

What is the expected output? What do you see instead?
 if you look at the 'Select' statement generated you will get

Array
(
    [0] => Array
        (
            [expr_type] => colref
            [alias] => `prj_seq_key`
            [base_expr] => aje.
            [sub_tree] => 
        )
)

where you sould get

Array
(
    [0] => Array
        (
            [expr_type] => colref
            [alias] => aje.`prj_seq_key`
            [base_expr] => aje.prj_seq_key`
            [sub_tree] => 
        )

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

Please provide any additional information below.

Original issue reported on code.google.com by alfredo....@gmail.com on 13 Jan 2011 at 12:40

GoogleCodeExporter commented 8 years ago
Thanks, I'll look into it.

Original comment by greenlion@gmail.com on 4 Feb 2011 at 8:53

GoogleCodeExporter commented 8 years ago
Fixed in SVN.

Added the following test:
SELECT c1.`some_column` or `c1`.`another_column` or c1.`some column` as `an 
alias`
          from some_table an_alias group by `an alias`, `alias2`;

Original comment by greenlion@gmail.com on 21 Mar 2011 at 7:02