#1646: Missing quoteIdentifier in Doctrine_Query_Abstract::set()
------------------------------+---------------------------------------------
  Reporter:  mg               |       Owner:  romanb                         
      Type:  defect           |      Status:  reopened                       
  Priority:  major            |   Milestone:  1.0.4                          
 Component:  Query/Hydration  |     Version:  1.0.3                          
Resolution:                   |    Keywords:  quoteIdentifier, query, quoting
  Has_test:  0                |    Mystatus:  Pending Core Response          
 Has_patch:  1                |  
------------------------------+---------------------------------------------
Changes (by adrive):

  * status:  closed => reopened
  * resolution:  fixed =>

Comment:

 The changeset 5178 break my functionality!

 I am using identifier quoting with Oracle due to NestedSet implementation
 is using Oracle keyword "LEVEL".

 I do not think, that this patch was the right for this problem. The
 identifier quoting should be in Doctrine_Query_Set part.

 The problem which raised now is that some set parts have also component
 name in as first parameter that is also quoted - live example from
 NestedSet:
 {{{
         $qLeft = $qLeft->update($componentName)
                 ->set($componentName . '.lft', $componentName.'.lft + ?',
 $delta)
                 ->where($componentName . '.lft >= ?', $first);

 }}}

 In my case the component name is `stMenu`.

 This will produce the failing sql query:
 '''ORA-00904: "stMenu"."lft": invalid identifier : UPDATE "st_menu" SET
 "stMenu"."lft" = "lft" + :oci_b_var_0 WHERE "lft" >= :oci_b_var_1 AND
 "root_id" = :oci_b_var_2'''

 That's because the quoted component name "stMenu" couldn't be translated
 to the quoted table name in Doctrine_Query_Set. Therefor I think, any
 quoting must be done in Doctrine_Query_Set rather then in
 Doctrine_Query_Abstract::set().

 I think, that doctrine has lack of tests that cover identifier quoting. I
 will create some in a near feature.

-- 
Ticket URL: <http://trac.doctrine-project.org/ticket/1646#comment:4>
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