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

php-sql-creator: FROM is added in SELECT without FROM #85

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In a parse tree with a SELECT without FROM (something like

SELECT function(foo, bar);

), a FROM is added in php-sql-creator.

Solution:

split the FROM clause off in processSelectStatement() as is the
case with the other clauses (WHERE, GROUP, ORDER...)

Code:

        protected function processSelectStatement($parsed) {
            $sql = $this->processSELECT($parsed['SELECT']);
            if (isset($parsed['FROM'])) {
                $sql .= " " . $this->processFROM($parsed['FROM']);
            }

Original issue reported on code.google.com by adrian.p...@googlemail.com on 14 Dec 2012 at 3:07

GoogleCodeExporter commented 8 years ago
I have added your code into the repository, thanks again!

Original comment by pho...@gmx.de on 23 Oct 2013 at 9:08