DDC-317: Using a function only in hydration returns only one result #3950

doctrinebot opened this Issue Feb 11, 2010 · 6 comments

1 participant


Jira issue originally created by user @beberlei:

Output of $arg:

array(1) {
  array(1) {
    string(25) "Jonathan W.Administration"
    public function testConcatFunction()
        $arg = $this->_em->createQuery('SELECT CONCAT(m.name, m.department) AS namedep FROM Doctrine\Tests\Models\Company\CompanyManager m')

        $this->assertEquals(4, count($arg)); // fails with 1

    protected function generateFixture()
        $manager1 = new CompanyManager();
        $manager1->setName('Roman B.');

        $manager2 = new CompanyManager();
        $manager2->setName('Benjamin E.');

        $manager3 = new CompanyManager();
        $manager3->setName('Guilherme B.');
        $manager3->setDepartment('Complaint Department');

        $manager4 = new CompanyManager();
        $manager4->setName('Jonathan W.');


Comment created by @beberlei:

Additional bug, changing the DQL to:

SELECT CONCAT(m.name, m.department) AS namedep FROM Doctrine\Tests\Models\Company\CompanyManager m WHERE m.id = 4

returns an empty result.


Comment created by @beberlei:

Thie following DQL gives a partial error bug:

SELECT m, m.salary+2500 AS add FROM Doctrine\Tests\Models\Company\CompanyManager m


Exception: [Doctrine\Common\DoctrineException] Loading partial objects is dangerous. Fetch full objects or consider using a different fetch mode. If you really want partial objects, set the doctrine.forcePartialLoad query hint to TRUE.

Comment created by @beberlei:

The same goes for - * and /


Comment created by @beberlei:

Generated SQL of the CONCAT Example:

SELECT CONCAT(c0*.name, c1_.department) AS sclr0 FROM company_managers c2_ INNER JOIN company_employees c1_ ON c2_.id = c1_.id INNER JOIN company_persons c0_ ON c2_.id = c0*.id

Comment created by romanb:

Should be fixed now.


Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added this to the 2.0-BETA1 milestone Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
@doctrinebot doctrinebot added the Bug label Dec 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment