Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty table alias in query, in Builder method addFrom() #14366

Jeckerson opened this issue Sep 8, 2019 · 1 comment


Copy link

@Jeckerson Jeckerson commented Sep 8, 2019

Found bug in Phalcon API (

$builder = new Phalcon\Mvc\Model\Query\Builder();

Which generates incorrect query

SELECT [].* FROM [Niden\Models\Users] AS [] WHERE ((username = :username:) AND (password = :password:)) AND (status = :status:)

It works correctly if specify second parameter of addForm() method.

$builder = new Phalcon\Mvc\Model\Query\Builder();
$builder->addFrom(Users::class, 'table1');


  • Phalcon version: (4.0-beta.2)
  • PHP Version: (7.2)
  • Operating System: Ubuntu 18.04
  • Installation type: Compiling from source
  • Zephir version (if any): -
  • Server: Nginx
  • Other related info (Database, table schema): MySQL
Jeckerson added a commit to phalcon/rest-api that referenced this issue Sep 8, 2019
@Jeckerson Jeckerson changed the title Empty alias query in Builder method addFrom() Empty table alias in query, in Builder method addFrom() Sep 8, 2019
@niden niden added this to To do in 4.0 Release via automation Sep 8, 2019
@ruudboon ruudboon referenced this issue Sep 12, 2019
4 of 5 tasks complete
@ruudboon ruudboon moved this from To do to In progress in 4.0 Release Sep 12, 2019

This comment has been minimized.

Copy link

@sergeyklay sergeyklay commented Sep 12, 2019

Fixed in the 4.0.x branch. Feel free to open a new issue if the problem appears again. Thank you for the bug report.

@sergeyklay sergeyklay closed this Sep 12, 2019
4.0 Release automation moved this from In progress to Done Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4.0 Release
3 participants
You can’t perform that action at this time.