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

Parser Problem when select from union expression #95

Open GoogleCodeExporter opened 8 years ago

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

Please help, i have problem when i run this query
$sql="SELECT * FROM ((SELECT 1 AS `ID`) UNION (SELECT 2 AS `ID`)) AS `Tmp`";
$parser=new PHPSQLParser($sql);

Original issue reported on code.google.com by hith2...@gmail.com on 3 Aug 2013 at 6:37

GoogleCodeExporter commented 8 years ago
This is a problem of the processFrom() method of the parser, it doesn't know 
the UNION keyword, so it interprets the construction as table name. Because of 
the space character just before UNION, the method thinks, that UNION is the 
alias of the table and ignores all the rest after the next space character 
right after UNION. I'll try to fix that.

Original comment by pho...@gmx.de on 23 Oct 2013 at 10:35

GoogleCodeExporter commented 8 years ago

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