Re: cvs: php4 /pear/DB oci8.php
| From: | Thies C. Arntzen | Date: | Sun, 06 Jan 2002 07:41:48 +0000 |
| Subject: | Re: cvs: php4 /pear/DB oci8.php | ||
| References: | 1 | Groups: | php.pear.cvs |
| Request: | Send a blank email to pear-cvs+get-1849@lists.php.net to get a copy of this message | ||
On Sun, Jan 06, 2002 at 04:36:33AM -0000, Thomas V.V.Cox wrote:
> cox Sat Jan 5 23:36:33 2002 EDT
>
> Modified files:
> /php4/pear/DB oci8.php
> Log:
> - use count(*) instead of count(a, b)
have you done some benchmarks on this? i believe that
count(primary_key) will be the fastest and count(*) the
slowest way of geting counts from oracle.
tc
> - 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;
>
>
>
> --
> PEAR CVS Mailing List (http://pear.php.net/)
> To unsubscribe, e-mail: pear-cvs-unsubscribe@lists.php.net
> For additional commands, e-mail: pear-cvs-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>