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

Bug #101 fetchRow method in oci8 backend ignores options["optimize"] setting
Submitted: 2003-10-14 16:19 UTC
From: massimo dot ferrario at inforeti dot it Assigned: danielc
Status: Closed Package: DB
PHP Version: 4.3.2 OS: linux
Roadmaps: (Not assigned)    
Subscription  
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes. If this is not your bug, you can add a comment by following this link. If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
2003-12-29 03:23 UTC
Package:
Bug Type:
Summary:
From: massimo dot ferrario at inforeti dot it
New email:
PHP Version: Package Version: OS:

 

 [2003-10-14 16:19 UTC] massimo dot ferrario at inforeti dot it
Description: ------------ I found a bug (or is it a feature?) in the fetchRow method implementation of the DB_oci8 class. While fetchInto method checks if $this->options['optimize'] is set to 'portability', and if it is converts all the field names to lower case, fetchRow does not. So, after a fetchRow, the code that looks for $row['key'] finds it empty, as only $row['KEY'] is set. I did not notice this problem before before I always used the DB::fetchRow method, and in the code ->dbh->fetchInto is called. The patch is simple: function &fetchRow($result, $fetchmode = DB_FETCHMODE_DEFAULT) { if ($fetchmode == DB_FETCHMODE_DEFAULT) { $fetchmode = $this->fetchmode; } if ($fetchmode & DB_FETCHMODE_ASSOC) { $moredata = @OCIFetchInto($result, $row, OCI_ASSOC + OCI_RETURN_NULLS + OCI_RETURN_LOBS); } else { $moredata = @OCIFetchInto($result, $row, OCI_RETURN_NULLS + OCI_RETURN_LOBS); } if (!$moredata) { return NULL; } //patch begin elseif ($this->options['optimize'] == 'portability') $row = array_change_key_case($row, CASE_LOWER); //patch else return $row; } Please note that I am using // $Id: oci8.php,v 1.4 2002/07/02 16:39:16 mj Exp $ this version of the oci8 library

Comments

 [2003-12-10 08:14 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2003-12-23 09:28 UTC] massimo dot ferrario at inforeti dot it
What do you mean with "version 1.9"? I can only see 1.5.0 RC2 in the DB package information page (http://pear.php.net/package/DB). Do you really want to remove the fetchRow method from the DB_result object and break nearly all the code around?
 [2003-12-29 03:23 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!