#1646: Missing quoteIdentifier in Doctrine_Query_Abstract::set()
---------------------------------------------+------------------------------
 Reporter:  mg                               |       Owner:  romanb 
     Type:  defect                           |      Status:  new    
 Priority:  major                            |   Milestone:  Unknown
Component:  Query/Hydration                  |     Version:  1.0.3  
 Keywords:  quoteIdentifier, query, quoting  |    Has_test:  0      
 Mystatus:  Pending Core Response            |   Has_patch:  1      
---------------------------------------------+------------------------------
 '''Doctrine_Query_Abstract''' on line '''1508''':

 {{{
 return $this->_addDqlQueryPart('set', $key . ' = ' . $value, true);
 }}}

 should be changed to:

 {{{
 return $this->_addDqlQueryPart('set', $this->_conn->quoteIdentifier($key)
 . ' = ' . $value, true);
 }}}

 Without it queries with reserved keyword do not work, to give an example:

 {{{
 Doctrine_Query::create()
         ->update('Category')
         ->set('default', 0)
         ->where('id_lang = ?', $category->id_lang)
         ->execute();
 }}}

 Generates the following query (Missing quotes):

 {{{
 UPDATE `core_categories` SET default = 0 WHERE `id_lang` = ?
 }}}

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