spamspam252 / 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 expression loses alias when parenthesis can be left out #132

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. define statement "select (c1 - c2) AS c3 from t1"
2. subsequent parse and create will produce "SELECT (c1 - c2) FROM t1" 

What is the expected output? What do you see instead?
expected : "select (c1 - c2) AS c3 from t1"

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

Please provide any additional information below.
Next two statements will be reproduced correctly :
"select c1 - c2 AS c3 from t1"
"select 1 * (c1 - c2) c3 from t1" (the "AS" can be left out)
next statement will not be reproduced correctly
"select (1 * (c1 - c2)) AS c3 from t1"

Original issue reported on code.google.com by Henk.Blo...@gmail.com on 5 Mar 2014 at 10:23

GoogleCodeExporter commented 8 years ago
Fixed in r1167. Please check the solution.

Original comment by pho...@gmx.de on 5 Mar 2014 at 10:38

GoogleCodeExporter commented 8 years ago
Ls,
just checked with a pretty complicated SELECT statement.
It runs fine now.
You solve problems faster than i can run into them!
Thanks,
Henk

Original comment by Henk.Blo...@gmail.com on 5 Mar 2014 at 10:49

GoogleCodeExporter commented 8 years ago
LOL! I always try to reduce the issue-list to about 10 entries :-)

Original comment by pho...@gmx.de on 6 Mar 2014 at 5:39