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

Request #13843 $_query property not properly restored in fetch()
Submitted: 2008-05-06 13:39 UTC
From: markus Assigned:
Status: Open Package: DB_DataObject (version 1.8.8)
PHP Version: 5.2.5 OS: Linux
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 38 + 39 = ?

 
 [2008-05-06 13:39 UTC] markus (Markus Fischer)
Description: ------------ In fetch(), is there a reason why the $_query property is not restored to its initial value after the last row has been fetched in DB_DataObject::fetch() on line 550? The property is set to false [line 575] to indicate there is more data to fetch, but after the last row has been fetched there is no reason to keep the DataObject from being reused as far as we can see. The process of backing up $_query and restoring it is applied successfully in the find() method (see line 410 and 468).

Comments

 [2008-05-06 14:26 UTC] alan_k (Alan Knowles)
From what I remember many moons ago, Doing multiple queries on the object had a number of undefined behaviors, so to make it more difficult to re-use, that was the best approach. It's probably worth investigating what variables (both object and global static's are actually altered by a find() call, then see if the can all be reset correctly...) Note that you do increase the already pretty horrific memory consumption if you store the variable and keep them in the object, that is likely to get cloned...