Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.11.5

Doc Bug #9140 quote_identifiers = 1 doesn't work for orderBy
Submitted: 2006-10-23 12:14 UTC
From: chrismir Assigned: saltybeagle
Status: Closed Package: DB_DataObject (version 1.8.4)
PHP Version: 5.1.2 OS: Linux
Roadmaps: (Not assigned)    

 [2006-10-23 12:14 UTC] chrismir (Chris van de Wouw)
Description: ------------ quote_identifiers = 1 doesn't work for identifiers used in the orderBy method. Test script: --------------- $options = &PEAR::getStaticProperty('DB_DataObject','options'); $options = array( 'quote_identifiers' => 1 ); $do = DB_DataObject::factory('table'); $do->orderBy('when ASC'); $do->find(); Expected result: ---------------- QUERY: SELECT * FROM `table` ORDER BY `when` ASC Actual result: -------------- QUERY: SELECT * FROM `table` ORDER BY when ASC


 [2006-10-23 23:19 UTC] alan_k (Alan Knowles)
since this would involve doing crazy regex's on the input, and would likely break more often that it worked.. it's probably worth leaving out. The idea behind those methods (like whereAdd) is that you pretty much send it the raw data. I dont think changing that for the 'edge' cases is that good an idea, when the workarounds are pretty simple. *** it might be worth noting in the manual I guess - changing to a doc issue.
 [2006-10-24 09:15 UTC] chrismir
I can understand it would involve 'dangerous' addition of regex's etc. Good thing you are going to note it in the manual, but I do not agree there is always a simple work around. In my case I stumbled against this problem while using StructuresDatagrid with datasource DataObject and renderer HTMLTable. This class gives me a nice (paged) table where the headers can be clicked to order on that field. So here I have no control on the orderBy call. The only thing I can do is strictly dont't use sql keywords. thanks for your time.
 [2006-10-24 09:21 UTC] alan_k (Alan Knowles)
can you file it as a bug of StructuresDatagrid as well.
 [2006-10-24 09:31 UTC] chrismir
I don't think this is a bug of StructuresDatagrid and I'm afraid it won't be appreciated if I file it as one. But I could file a request. ;-)
 [2008-03-21 17:30 UTC] saltybeagle (Brett Bieber)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on by the end of next Sunday (CET). If this was a problem with the website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.