Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.2.1
-
Fix Version/s: None
-
Component/s: Query
-
Labels:None
Description
First up Doctrine_Query_Set should extend Doctrine_Query_Condition so that the parseLiteralValue method is available in _processPossibleAggExpression().
However I am not sure what this method is really supposed to do. It seems to do some reordering of clauses, but in my case it actually drops off some parts of my expression:
Doctrine_Query::create()
->update('Document')
->set('clause_ordering', "IF(clause_ordering IS NULL, '$id', CONCAT(clause_ordering, ',$id'))")
->where('id = ?', $document_id)
->execute();
Results in "UPDATE document SET clause_ordering = IF(clause_ordering IS NULL, '67', CONCAT(clause_ordering)) WHERE (id = ?)"
And not as expected "UPDATE document SET clause_ordering = IF(clause_ordering IS NULL, '67', CONCAT(clause_ordering, ',67')) WHERE (id = ?)"
Adding a space after IF and CONCAT fixes the issue, but is obviously a hack to get around the regexp in _processPossibleAggExpression()