Uploaded image for project: 'Doctrine 1'
  1. Doctrine 1
  2. DC-585

Hydrate Array does not return full array, when Hydrate Scalar does


    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Environment:
      OS : Ubuntu 9.04
      PHP : PHP 5.2.6-3ubuntu4.5


      Description : Upon hydrating as array I will receive one row returned. If I am to hydrate as Scalar, I will get 200+ rows. Also, if i echo the sql ($q->getSqlQuery()) and run that raw, it will also return around 200+ rows.

      $q = Doctrine_Query::create()
      ->select('DISTINCT(co.name) AS field, co.name AS value')
      ->from('Model_Country co')
      ->leftJoin('co.City ci');

      //here we will get only the first row
      $results = $q->execute(array(), Doctrine::HYDRATE_ARRAY);

      //Here we will get all 200+ rows
      $results = $q->execute(array(), Doctrine::HYDRATE_SCALAR);

      I have yet to dig to deep into this, but if it is indeed a bug, my guess is it is in Doctrine_Hydrator_Graph::hydrateResultSet()

      I can provide more data if needed.

      1. Doctrine-DC-585-b.patch
        0.7 kB
        Pierrot Evrard
      2. Doctrine-DC-585-c.patch
        0.7 kB
        Pierrot Evrard


        solomonjames James Solomon created issue -
        loops Pierrot Evrard made changes -
        Field Original Value New Value
        Attachment Doctrine-DC-585-b.patch [ 10950 ]
        loops Pierrot Evrard made changes -
        Attachment Doctrine-DC-585-c.patch [ 10976 ]


          • Assignee:
            jwage Jonathan H. Wage
            solomonjames James Solomon
          • Votes:
            4 Vote for this issue
            5 Start watching this issue


            • Created: