cvs: pear /MDB2/MDB2/Driver oci8.php

From: Date: Thu, 28 Jul 2005 09:27:07 +0000
Subject: cvs: pear /MDB2/MDB2/Driver oci8.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-33403@lists.php.net to get a copy of this message
lsmith Thu Jul 28 05:27:07 2005 EDT Modified files: /pear/MDB2/MDB2/Driver oci8.php Log: - fixed several major bugs in _execute() http://cvs.php.net/diff.php/pear/MDB2/MDB2/Driver/oci8.php?r1=1.79&r2=1.80&ty=u Index: pear/MDB2/MDB2/Driver/oci8.php diff -u pear/MDB2/MDB2/Driver/oci8.php:1.79 pear/MDB2/MDB2/Driver/oci8.php:1.80 --- pear/MDB2/MDB2/Driver/oci8.php:1.79 Tue Jun 28 06:05:53 2005 +++ pear/MDB2/MDB2/Driver/oci8.php Thu Jul 28 05:27:07 2005 @@ -43,7 +43,7 @@ // | Author: Lukas Smith <smith@backendmedia.com> | // +----------------------------------------------------------------------+ -// $Id: oci8.php,v 1.79 2005/06/28 10:05:53 quipo Exp $ +// $Id: oci8.php,v 1.80 2005/07/28 09:27:07 lsmith Exp $ /** * MDB2 OCI8 driver @@ -84,7 +84,6 @@ $this->supported['replace'] = true; $this->supported['sub_selects'] = true; $this->supported['auto_increment'] = false; - $this->supported['primary_key'] = true; $this->options['DBA_username'] = false; $this->options['DBA_password'] = false; @@ -697,8 +696,7 @@ function &fetchRow($fetchmode = MDB2_FETCHMODE_DEFAULT, $rownum = null) { if (!$this->_skipLimitOffset()) { - $null = null; - return $null; + return null; } if (!is_null($rownum)) { $seek = $this->seek($rownum); @@ -724,8 +722,7 @@ return $this->db->raiseError(MDB2_ERROR_NEED_MORE_DATA, null, null, 'fetchRow: resultset has already been freed'); } - $null = null; - return $null; + return null; } if ($this->db->options['portability'] & MDB2_PORTABILITY_RTRIM) { $this->db->_rtrimArrayValues($row); @@ -904,8 +901,7 @@ $fetchmode = $this->db->fetchmode; } if (!$this->_fillBuffer($target_rownum)) { - $null = null; - return $null; + return null; } $row = $this->buffer[$target_rownum]; if ($fetchmode & MDB2_FETCHMODE_ASSOC) { @@ -1035,8 +1031,7 @@ if ($isManip) { return MDB2_OK; } - $null = null; - return $null; + return null; } $connected = $this->db->connect(); @@ -1045,15 +1040,13 @@ } $result = MDB2_OK; - $lobs = array(); + $lobs = $quoted_values = array(); $i = 0; $types_numeric = is_numeric(key($this->types)); foreach ($this->values as $parameter => $value) { $type_key = $types_numeric ? $i : $parameter; $type = isset($this->types[$type_key]) ? $this->types[$type_key] : null; - $lob_type = null; if ($type == 'clob' || $type == 'blob') { - $lob_type = ($type == 'blob' ? OCI_B_BLOB : OCI_B_CLOB); $lobs[$i]['file'] = false; if (is_resource($value)) { $fp = $value; @@ -1068,25 +1061,30 @@ } } $lobs[$i]['value'] = $value; - $quoted_value = $lobs[$i]['descriptor'] = @OCINewDescriptor($this->db->connection, OCI_D_LOB); - if (!is_object($quoted_value)) { + $lobs[$i]['descriptor'] = @OCINewDescriptor($this->db->connection, OCI_D_LOB); + if (!is_object($lobs[$i]['descriptor'])) { $result = $this->db->raiseError(); break; } + $lob_type = ($type == 'blob' ? OCI_B_BLOB : OCI_B_CLOB); + if (!@OCIBindByName($this->statement, ':'.$parameter, $lobs[$i]['descriptor'], -1, $lob_type)) { + $result = $this->db->raiseError($this->statement); + break; + } } else { - $quoted_value = $this->db->quote($value, $type, false); - if (PEAR::isError($quoted_value)) { - return $quoted_value; + $quoted_values[$i] = $this->db->quote($value, $type, false); + if (PEAR::isError($quoted_values[$i])) { + return $quoted_values[$i]; + } + if (!@OCIBindByName($this->statement, ':'.$parameter, $quoted_values[$i])) { + $result = $this->db->raiseError($this->statement); + break; } - } - if (!@OCIBindByName($this->statement, ':'.$parameter, $quoted_value, -1, $lob_type)) { - $result = $this->db->raiseError($this->statement); - break; } ++$i; } - if (PEAR::isError($result)) { + if (!PEAR::isError($result)) { $mode = (!empty($lobs) || $this->db->in_transaction) ? OCI_DEFAULT : OCI_COMMIT_ON_SUCCESS; if (!@OCIExecute($this->statement, $mode)) { return $this->db->raiseError($this->statement);

« previous php.pear.cvs (#33403) next »