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

Bug #9133 Wrong check in Statement class, bindValue()
Submitted: 2006-10-22 15:59 UTC
From: wiesemann Assigned: wiesemann
Status: Closed Package: MDB2 (version CVS)
PHP Version: Irrelevant OS: Irrelevant
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 : 40 - 17 = ?

 
 [2006-10-22 15:59 UTC] wiesemann (Mark Wiesemann)
Description: ------------ In MDB2.php, MDB2_Statement_Common class, bindValue() method, there is a wrong check in line 3877. Instead of checking the array _value_ with in_array, the array _key_ needs to be checked (isset or array_key_exists). (The positions array has the position number as the key, and the position in the string as the value.) I've noticed this because I'm currently adding support for insert/update/delete operations to Structures_DataGrid_DataSource_DBTable. I'm not really sure why I wasn't affected by this until now, as I'm doing update() (only this currently ready in SDG_DS_DBTable) directly via DB_Table since a long time.

Comments

 [2006-10-22 16:00 UTC] wiesemann (Mark Wiesemann)
BTW: The error raised in lines 3878/3879 get's lost in bindValues(). It isn't returned there.
 [2006-10-22 17:51 UTC] lsmith (Lukas Smith)
I have just added some error handling into the bindValues()/bindParams() methods. However for the actual error, could it be that you are using an outdated drivers?
 [2006-10-22 18:18 UTC] wiesemann (Mark Wiesemann)
> I have just added some error handling into the > bindValues()/bindParams() methods. Thanks. > However for the actual error, could it be that you are > using an outdated drivers? It could be, yes. I've run "cvs update", but copied only MDB2.php to the right place. :-(