cvs: pear /DB/DB common.php oci8.php
| From: | Daniel Convissor | Date: | Sun, 20 Feb 2005 16:05:14 +0000 |
| Subject: | cvs: pear /DB/DB common.php oci8.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-29532@lists.php.net to get a copy of this message | ||
danielc Sun Feb 20 11:05:14 2005 EDT
Modified files:
/pear/DB/DB common.php oci8.php
Log:
* Add ocisetprefetch() calls in query() and execute().
This determines how many rows of a result set get buffered.
To adjust the quantity, see the "buffer" option in setOptions().
Request 3241.
http://cvs.php.net/diff.php/pear/DB/DB/common.php?r1=1.128&r2=1.129&ty=u
Index: pear/DB/DB/common.php
diff -u pear/DB/DB/common.php:1.128 pear/DB/DB/common.php:1.129
--- pear/DB/DB/common.php:1.128 Sat Feb 19 19:44:47 2005
+++ pear/DB/DB/common.php Sun Feb 20 11:05:12 2005
@@ -20,7 +20,7 @@
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: common.php,v 1.128 2005/02/20 00:44:47 danielc Exp $
+ * @version CVS: $Id: common.php,v 1.129 2005/02/20 16:05:12 danielc Exp $
* @link http://pear.php.net/package/DB
*/
@@ -79,6 +79,7 @@
* @see DB_common::setOption()
*/
var $options = array(
+ 'buffer' => 1000,
'persistent' => false,
'ssl' => false,
'debug' => 0,
@@ -513,6 +514,10 @@
* <br />should results be freed automatically when there are no
* more rows?
* </li><li>
+ * <var>buffer</var> <kbd>integer</kbd> = <samp>1000</samp>
+ * <br />how many rows of the result set should be buffered?
+ * This is only used by the oci8 driver at this point.
+ * </li><li>
* <var>debug</var> <kbd>integer</kbd> = <samp>0</samp>
* <br />debug level
* </li><li>
http://cvs.php.net/diff.php/pear/DB/DB/oci8.php?r1=1.98&r2=1.99&ty=u
Index: pear/DB/DB/oci8.php
diff -u pear/DB/DB/oci8.php:1.98 pear/DB/DB/oci8.php:1.99
--- pear/DB/DB/oci8.php:1.98 Sat Feb 19 19:44:48 2005
+++ pear/DB/DB/oci8.php Sun Feb 20 11:05:12 2005
@@ -20,7 +20,7 @@
* @author Daniel Convissor <danielc@php.net>
* @copyright 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: oci8.php,v 1.98 2005/02/20 00:44:48 danielc Exp $
+ * @version CVS: $Id: oci8.php,v 1.99 2005/02/20 16:05:12 danielc Exp $
* @link http://pear.php.net/package/DB
*/
@@ -284,6 +284,9 @@
/**
* Sends a query to the database server
*
+ * To determine how many rows of a result set get buffered using
+ * ocisetprefetch(), see the "buffer" option in setOptions().
+ *
* @param string the SQL query string
*
* @return mixed + a PHP result resrouce for successful SELECT queries
@@ -309,9 +312,12 @@
return $this->oci8RaiseError($result);
}
$this->last_stmt = $result;
- // Determine which queries that should return data, and which
- // should return an error code only.
- return DB::isManip($query) ? DB_OK : $result;
+ if (DB::isManip($query)) {
+ return DB_OK;
+ } else {
+ @ocisetprefetch($result, $this->options['buffer']);
+ return $result;
+ }
}
// }}}
@@ -583,6 +589,9 @@
/**
* Executes a DB statement prepared with prepare().
*
+ * To determine how many rows of a result set get buffered using
+ * ocisetprefetch(), see the "buffer" option in setOptions().
+ *
* @param resource $stmt a DB statement resource returned from prepare()
* @param mixed $data array, string or numeric data to be used in
* execution of the statement. Quantity of items
@@ -648,6 +657,7 @@
if ($this->manip_query[(int)$stmt]) {
$tmp = DB_OK;
} else {
+ @ocisetprefetch($stmt, $this->options['buffer']);
$tmp =& new DB_result($this, $stmt);
}
return $tmp;