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

Bug #4535 postgresql's boolean still broken
Submitted: 2005-06-06 08:41 UTC
From: daniel at konczyk dot net Assigned: alan_k
Status: Closed Package: DB_DataObject
PHP Version: 4.3.10 OS: debian gnu/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 : 43 - 43 = ?

 
 [2005-06-06 08:41 UTC] daniel at konczyk dot net
Description: ------------ Handling of boolean values in postgresql database is still broken in db_dataobject look at the current CVS, method 'update', line 1198 ($v & DB_DATAOBJECT_BOOL) ? (int)(bool)$this->$k : $this->$k when you select boolean field from postgresql, then the result value will be (let's assume there's 'not null' flag) 't' for true or 'f' for false then piece of code above will always return true, in this example it will return 1 and thus will update all boolean fields that do not appear in posted data to true... unless I overlooked something

Comments

 [2005-06-16 02:11 UTC] alan_k
can you suggest a patch?
 [2005-06-16 08:14 UTC] daniel at konczyk dot net
Well, you have to make a dirty patch for postgresql I think. I know you don't like it and you have already told us a zillion times about it, but as that's the only way I guess, as this is postgresql-only 'feature' Actually, you have to take care of false only, for example ($v & DB_DATAOBJECT_BOOL) ? (int)(bool)($this->$k == 'f'?0:$this->$k) : $this->$k or so I know it looks awful, but I'd better it looks so, than do not work at all..
 [2005-06-25 03:27 UTC] alan_k
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better.