#1642: problem with subqueries + hydration
------------------------------+---------------------------------------------
  Reporter:  dbojdo           |       Owner:  romanb               
      Type:  defect           |      Status:  closed               
  Priority:  major            |   Milestone:  1.0.4                
 Component:  Query/Hydration  |     Version:  1.0.3                
Resolution:  invalid          |    Keywords:  subquery, hydration  
  Has_test:  0                |    Mystatus:  Pending Core Response
 Has_patch:  0                |  
------------------------------+---------------------------------------------
Changes (by guilhermeblanco):

  * status:  new => closed
  * resolution:  => invalid

Old description:

> The query with subuery returns only one record... for example
> We've got query like this:
> select('uo.bid as bid')
> ->from('UserOperator uo')
> ->addWhere('uo.bid IN (SELECT ub.bid FROM UserIdentityBid ub WHERE
> ub.identity_id = ?)')
> ->addOrderBy('uo.bid ASC')
>
> PDO returns 2 or more results - it's good,
> but doctrine collection has only first element
>
> everything is all right when i don't alias the select field
> [select('uo.bid as bid')]
>
> In Doctrine 1.0.2 that bug doesn't exist.

New description:

 The query with subuery returns only one record... for example
 We've got query like this:
 select('uo.bid as bid')
 ->from('UserOperator uo')
 ->addWhere('uo.bid IN (SELECT ub.bid FROM UserIdentityBid ub WHERE
 ub.identity_id = ?)')
 ->addOrderBy('uo.bid ASC')

 PDO returns 2 or more results - it's good,
 but doctrine collection has only first element

 everything is all right when i don't alias the select field
 [select('uo.bid as bid')]

 In Doctrine 1.0.2 that bug doesn't exist.

Comment:

 Ticket is invalid.

 You can't alias select fields, as long as you're not
 Doctrine::HYDRATE_NONE or Doctrine::HYDRATE_SCALAR.

 Closing ticket. This is the expected behavior (otherwise Hydrator becomes
 crazy).

-- 
Ticket URL: <http://trac.doctrine-project.org/ticket/1642#comment:3>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"doctrine-svn" group.
 To post to this group, send email to [email protected]
 To unsubscribe from this group, send email to [EMAIL PROTECTED]
 For more options, visit this group at 
http://groups.google.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---

Reply via email to