#1657: dql_callback or softdelete template bounde variable bug ?
-----------------------------------+----------------------------------------
 Reporter:  nORKy                  |       Owner:  romanb 
     Type:  defect                 |      Status:  new    
 Priority:  major                  |   Milestone:  Unknown
Component:  Query/Hydration        |     Version:  1.0.3  
 Keywords:  dql_callback           |    Has_test:  1      
 Mystatus:  Pending Core Response  |   Has_patch:  0      
-----------------------------------+----------------------------------------
 I use the soft delete template to delete some Users record.
 In the data fixture, I don't set any value to 'deleted'.

 With a SQLITE database (and the sandbox 1.0.3 packages) :

 Without "setAttribute('use_dql_callbacks', true);" the query gets my
 record.
 With, I have no record returned.

 With a mysql database, I have this error :
 Error: SQLSTATE[HY093]: Invalid parameter number: number of bound
 variables does not match number of tokens

 I can't reproduce this error with sqlite, but I can show you my stack
 stace ;

 {{{
 #0
 /usr/local/share/Doctrine-1.0.3/lib/Doctrine/Connection/Statement.php(244):
 Doctrine_Connection->rethrowException(Object(PDOException),
 Object(Doctrine_Connection_Statement))
 #1 /usr/local/share/Doctrine-1.0.3/lib/Doctrine/Connection.php(1004):
 Doctrine_Connection_Statement->execute(Array)
 #2 /usr/local/share/Doctrine-1.0.3/lib/Doctrine/Query/Abstract.php(945):
 Doctrine_Connection->execute('SELECT u.id AS ...', Array)
 #3 /usr/local/share/Doctrine-1.0.3/lib/Doctrine/Query/Abstract.php(991):
 Doctrine_Query_Abstract->_execute(Array)
 #4 /usr/local/share/Doctrine-1.0.3/lib/Doctrine/Table.php(1250):
 Doctrine_Query_Abstract->execute(Array, NULL)
 #5 /usr/home/jaudin/php/agoraspot/lib/My/Controller/Plugin/Auth.php(30):
 Doctrine_Table->find('get.identity', Array)
 }}}

 some print_r in Doctrine/Connection at line 1004 say :
 {{{
 SELECT u.id AS u__id, u.name AS u__name, u.fname AS u__fname, d.id AS
 d__id, g.id AS g__id FROM user u LEFT JOIN domain d ON u.domain_id = d.id
 LEFT JOIN groups g ON u.group_id = g.id WHERE u.id = ? AND u.deleted = ?
 Array
 (
     [0] => 1
 )
 }}}
 you can see there is one var the is missing.

 I join a modified sandbox tgz to test it (I modified index.php, fixtures
 and models)


 If I switch back to 1.0.2, there is no errors, no bug.

-- 
Ticket URL: <http://trac.doctrine-project.org/ticket/1657>
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