#1519: Mixed prepared placeholder style caused by `whereIn()` makes PDO fail
-----------------------------------+----------------------------------------
 Reporter:  francois               |       Owner:  jwage
     Type:  defect                 |      Status:  new  
 Priority:  minor                  |   Milestone:       
Component:  Attributes             |     Version:  1.0.2
 Keywords:                         |    Has_test:  0    
 Mystatus:  Pending Core Response  |   Has_patch:  0    
-----------------------------------+----------------------------------------
 Suppose I do this DQL:
 {{{
 $query->where('foo = :foo', array(':foo' => 'bar'))->whereIn('id',
 array(1, 2, 3));
 }}}

 Due to the `whereIn()` code, the resulting SQL looks like:
 {{{
 WHERE FOO = :foo AND id IN ?
 }}}

 When executing such a statement, PDO fails (at least under MySQL, even if
 not under SQLite) because of mixed prepared placeholder style:
 {{{
 PHP Fatal error:  Uncaught exception 'Doctrine_Connection_Mysql_Exception'
 with message
 'SQLSTATE[HY093]: Invalid parameter number: mixed named and positional
 parameters' (PDOException)
 }}}

 The only solution I see is to add a method to the query object so that the
 user can choose which prepared placeholder style Doctrine should use when
 doing some magic (and this happens in
 `Doctrine_Query_Abstract::_processWhereIn()` and
 `Doctrine_Query_Abstract::set()`).

-- 
Ticket URL: <http://trac.phpdoctrine.org/ticket/1519>
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