Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:OS : Ubuntu 9.04
PHP : PHP 5.2.6-3ubuntu4.5
Description
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.
I have found this in the google group, and he provides more detailed info, and appears to be the same exact issue : http://groups.google.com/group/doctrine-user/msg/8e4a8a673428fff0