cvs: php4 /pear/DB oci8.php
| From: | Thomas V.V.Cox | Date: | Sun, 06 Jan 2002 04:36:33 +0000 |
| Subject: | cvs: php4 /pear/DB oci8.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-1843@lists.php.net to get a copy of this message | ||
cox Sat Jan 5 23:36:33 2002 EDT
Modified files:
/php4/pear/DB oci8.php
Log:
- use count(*) instead of count(a, b)
- preserve the error handler when testing the sequence
- missing E_ALL fixes
Index: php4/pear/DB/oci8.php
diff -u php4/pear/DB/oci8.php:1.41 php4/pear/DB/oci8.php:1.42
--- php4/pear/DB/oci8.php:1.41 Sat Jan 5 21:19:49 2002
+++ php4/pear/DB/oci8.php Sat Jan 5 23:36:32 2002
@@ -17,7 +17,7 @@
// | |
// +----------------------------------------------------------------------+
//
-// $Id: oci8.php,v 1.41 2002/01/06 02:19:49 cox Exp $
+// $Id: oci8.php,v 1.42 2002/01/06 04:36:32 cox Exp $
//
// Database independent query interface definition for PHP's Oracle 8
// call-interface extension.
@@ -274,8 +274,8 @@
// emulate numRows for Oracle. yuck.
if ($this->options['optimize'] == 'portability' &&
$result === $this->last_stmt) {
- $countquery = preg_replace('/^\s*SELECT\s+(.*?)[,\s].*\s+FROM\s+/is',
- 'SELECT COUNT(\1) FROM ',
+ $countquery = preg_replace('/^\s*SELECT\s+(.*?)\s+FROM\s+/is',
+ 'SELECT COUNT(*) FROM ',
$this->last_query);
$save_query = $this->last_query;
$save_stmt = $this->last_stmt;
@@ -361,6 +361,7 @@
}
}
$binds = sizeof($tokens) - 1;
+ $newquery = '';
for ($i = 0; $i < $binds; $i++) {
$newquery .= $tokens[$i] . ":bind" . $i;
}
@@ -401,7 +402,7 @@
}
if ($types[$i] == DB_PARAM_OPAQUE) {
$fp = fopen($pdata[$i], "r");
- $pdata = '';
+ $pdata[$i] = '';
if ($fp) {
while (($buf = fread($fp, 4096)) != false) {
$pdata[$i] .= $buf;
@@ -581,7 +582,9 @@
$sqn = preg_replace('/[^a-z0-9_]/i', '_', $seq_name);
$repeat = 0;
do {
+ $this->expectError(DB_ERROR_NOSUCHTABLE);
$result = $this->query("SELECT ${sqn}_seq.nextval FROM dual");
+ $this->popExpect();
if ($ondemand && DB::isError($result) &&
$result->getCode() == DB_ERROR_NOSUCHTABLE) {
$repeat = 1;