cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

[BUG] Syntax error, unexpected token AS, near to ' [c]'

Open jarvischen opened this issue 13 years ago • 1 comments

Using: $builder = $this->modelsManager ->createBuilder() ->from(array('b' => 'Apps\Models\Blog\Blog')) ->columns(array('b.id',)) ->join('Apps\Models\Social\Comment', 'b.id = c.id', 'c'); $result = $builder->getQuery()->execute();

I get PhalconException: Syntax error, unexpected token AS, near to ' [c]'

echo $builder->getPhql();

The generated phql is: SELECT b.id FROM [Apps\Models\Blog\Blog] AS [b] JOIN [Apps\Models\Social\Comment] ON b.id = c.id AS [c]

But the expected result is: SELECT b.id FROM [Apps\Models\Blog\Blog] AS [b] JOIN [Apps\Models\Social\Comment] AS [c] ON b.id = c.id

jarvischen avatar Mar 12 '13 13:03 jarvischen

This is fixed in the 1.0.0 branch, thanks!

ghost avatar Mar 13 '13 01:03 ghost