Closed
Description
Hello,
Since 1.3.0 this PHQL query that used to work properly, doesn't now :
<?php
$di = new \Phalcon\DI\FactoryDefault();
class X extends \Phalcon\DI\Injectable
{
public function x()
{
$manager = $this->getDI()->getModelsManager();
$manager->executeQuery("SELECT id FROM Article WHERE CAST(mycolumn AS date)='2014-02-01'");
}
}
$x = new X;
$x->setDI($di);
$x->x();
This produces this PDO query :
SELECT "article"."id" FROM "public"."article" WHERE CAST("article"."mycolumn" AS ) = '2014-02-01'
I tested with another SQL function as CONVERT and it produces exactly the same issue.
I don't know if it is important or not, but my RDBMS is PostgreSql.
I have opened a discussion about this issue in the forum by the way ( http://forum.phalconphp.com/discussion/1863/phql-wrong-conversion-of-cast-and-convert-method-maybe-more- )
Thanks a lot !
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.