Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Invalid
    • Affects Version/s: 2.3
    • Fix Version/s: None
    • Component/s: DQL
    • Security Level: All
    • Labels:
    • Environment:
      Mac OS X Mountain Lion
      PHP 5.3.14 (cli)

      Description

      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.

        Activity

        Marcos García created issue -
        Marcos García made changes -
        Field Original Value New Value
        Description 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:rentgest 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.

        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:rentgest 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.

        Marcos García made changes -
        Description 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:rentgest 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.

        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:

        {code}
        $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');
        {code}

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

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

        {code}
        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$
        {code}
        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.

        Hide
        Fabio B. Silva added a comment -

        Hi Marcos,

        Could you try to add a failing test case ?

        Thanks ...

        Show
        Fabio B. Silva added a comment - Hi Marcos, Could you try to add a failing test case ? Thanks ...
        Hide
        Marcos García added a comment -

        Hi Fabio,

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

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

        Show
        Marcos García added a comment - Hi Fabio, I've updated Doctrine and now it seems that everything works OK... Thank you for your time... (and sorry) :S
        Marcos García made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Invalid [ 6 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DDC-2105, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Marcos García
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: