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

Alias was lost #100

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

Hello,
   I try this simple example:

   $sql = "SELECT 0 AS Zero FROM table";
   $parser = new PHPSQLParser($sql);
   $creator = new PHPSQLCreator($parser->parsed);
   echo $creator->created; 

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

I expect output: "SELECT 0 AS Zero FROM table"
but output is only: "SELECT 0 FROM table"

The part " AS Zero " was lost!

If I change constant 0 to calculated expression, for example 
"SELECT 0+0 AS Zero FROM table" then result is OK.

thanks
 Dominik

What version of the product are you using? On what operating system?
 php-sql-parser-20131024.zip, PHP 5.4.3, Windows XP

Please provide any additional information below.

Original issue reported on code.google.com by galusdom...@gmail.com on 12 Nov 2013 at 8:05

GoogleCodeExporter commented 8 years ago
Congratulation! You have logged the 100th issue :-)

It seems to be a problem of the Creator, the parser output is correct in r517.

Original comment by pho...@gmx.de on 12 Nov 2013 at 8:38

GoogleCodeExporter commented 8 years ago
This was an easy one. Try r519.

Original comment by pho...@gmx.de on 12 Nov 2013 at 8:48