PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Database » DB » Bug #739

oci8 numRows only works once for a result

Details

Submitted2004-02-12 08:39 UTC
Fromhsarbi at ninreag dot cwwsa dot ten (reverse)
Assigneddanielc
StatusWont fix
PackageDB
PHP VersionIrrelevant
OSSunOS 5.8 Sparc
Roadmaps(Not assigned)

Comments

[2004-02-12 08:39 UTC] hsarbi at ninreag dot cwwsa dot ten (reverse)

Description:
------------
Using oci8 with DB_PORTABILITY_NUMROWS enabled, if one has an result object and tries to retrieve the number of rows returned via numRows, it will work the first time. If then one tries to do this number again with the same result object, it will return an error object.

Reproduce code:
---------------
<?
/*
Code here to use an oci8 DSN with DB_PORTABILITY_NUMROWS mode on and retrieve a result object, assigning it to $result
*/

printf("%d\n", DB::isError($numrows = $result->numRows()) ? $numrows : -1);
printf("%d\n", DB::isError($numrows = $result->numRows()) ? -1 : $numrows);

?>

Expected result:
----------------
The same number outputted twice.

Actual result:
--------------
The number of rows in the result (as expected) and then a -1 (since $result !== $this->last_stmt for the second invocation of numRows() in the class DB_oci8).