Created
August 4, 2017 09:54
-
-
Save nickvergessen/d9f83cc3a8c9bcb8b5cd13922acae332 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php b/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php | |
index 21b06fa1..ee3af635 100644 | |
--- a/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php | |
+++ b/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php | |
@@ -81,6 +81,11 @@ class OCI8Statement implements \IteratorAggregate, Statement | |
private $boundValues = array(); | |
/** | |
+ * @var int|null | |
+ */ | |
+ private $rowCount = null; | |
+ | |
+ /** | |
* Creates a new OCI8Statement that uses the given connection handle and SQL statement. | |
* | |
* @param resource $dbh The connection handle. | |
@@ -316,6 +321,10 @@ class OCI8Statement implements \IteratorAggregate, Statement | |
*/ | |
public function rowCount() | |
{ | |
- return oci_num_rows($this->_sth); | |
+ if ($this->rowCount === null) { | |
+ $this->rowCount = oci_num_rows($this->_sth); | |
+ $this->closeCursor(); | |
+ } | |
+ return $this->rowCount; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment