DDC-2105: Error when rendering DQL query #2650

Closed
opened 2026-01-22 13:59:16 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Oct 26, 2012).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user marcosgdf:

I'm using Doctrine with Symfony 2.1. Everything was working OK in Symfony 2.0 so I think I was using Doctrine 2.2. Now I'm using Doctrine 2.3-dev (packagist) and when I run the following query in a EntityRepository:

$em->createQuery('SELECT u, tc FROM XBundle:X tc JOIN tc.usuario u JOIN tc.tax t WHERE tc.timestamp >= :date*from AND tc.timestamp <= :date*to AND t.type = :x GROUP BY tc.usuario');

Nothing happens, getResult() just returns array(0){}

I've done \Doctrine\Common\Util\Debug::dump($query); and this is the result:

object(stdClass)#487 (18) {
  ["*_CLASS_*"]=>
  string(18) "Doctrine\ORM\Query"
  ["_state"]=>
  int(1)
  ["_dql"]=>
  string(180) "SELECT u, tc FROM XBundle:X tc JOIN tc.usuario u JOIN tc.tax t WHERE tc.timestamp >= :date_from AND tc.timestamp Marcos:project marcos$ 

As you can see something happens because the dql query got cropped and seems like Doctrine is not working properly...

If I change 'WHERE tc.timestamp >= :date_from AND tc.timestamp <= :date_to' for 'WHERE tc.timestamp BETWEEN :date_from AND :date_to', then the query is run without any problem and the debug dump function shows a complete debug of $query.

Originally created by @doctrinebot on GitHub (Oct 26, 2012). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user marcosgdf: I'm using Doctrine with Symfony 2.1. Everything was working OK in Symfony 2.0 so I think I was using Doctrine 2.2. Now I'm using Doctrine 2.3-dev (packagist) and when I run the following query in a EntityRepository: ``` $em->createQuery('SELECT u, tc FROM XBundle:X tc JOIN tc.usuario u JOIN tc.tax t WHERE tc.timestamp >= :date*from AND tc.timestamp <= :date*to AND t.type = :x GROUP BY tc.usuario'); ``` Nothing happens, getResult() just returns array(0){} I've done \Doctrine\Common\Util\Debug::dump($query); and this is the result: ``` object(stdClass)#487 (18) { ["*_CLASS_*"]=> string(18) "Doctrine\ORM\Query" ["_state"]=> int(1) ["_dql"]=> string(180) "SELECT u, tc FROM XBundle:X tc JOIN tc.usuario u JOIN tc.tax t WHERE tc.timestamp >= :date_from AND tc.timestamp Marcos:project marcos$ ``` As you can see something happens because the dql query got cropped and seems like Doctrine is not working properly... If I change 'WHERE tc.timestamp >= :date_from AND tc.timestamp <= :date_to' for 'WHERE tc.timestamp BETWEEN :date_from AND :date_to', then the query is run without any problem and the debug dump function shows a complete debug of $query.
admin added the Bug label 2026-01-22 13:59:16 +01:00
admin closed this issue 2026-01-22 13:59:18 +01:00
Author
Owner

@doctrinebot commented on GitHub (Oct 29, 2012):

Comment created by @FabioBatSilva:

Hi Marcos,

Could you try to add a failing test case ?

Thanks ...

@doctrinebot commented on GitHub (Oct 29, 2012): Comment created by @FabioBatSilva: Hi Marcos, Could you try to add a failing test case ? Thanks ...
Author
Owner

@doctrinebot commented on GitHub (Dec 23, 2012):

Comment created by marcosgdf:

Hi Fabio,

I've updated Doctrine and now it seems that everything works OK...

Thank you for your time... (and sorry) :S

@doctrinebot commented on GitHub (Dec 23, 2012): Comment created by marcosgdf: Hi Fabio, I've updated Doctrine and now it seems that everything works OK... Thank you for your time... (and sorry) :S
Author
Owner

@doctrinebot commented on GitHub (Dec 23, 2012):

Issue was closed with resolution "Invalid"

@doctrinebot commented on GitHub (Dec 23, 2012): Issue was closed with resolution "Invalid"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#2650