diff options
author | Morris Jobke <hey@morrisjobke.de> | 2020-11-10 15:15:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-10 15:15:03 +0100 |
commit | f23c2162ad2d2883f08cc88c600a7d2ed4bd8a93 (patch) | |
tree | d8bcdf4ad04525f62f8ad5a43d5b9ba6cc698a08 /lib/private/legacy | |
parent | 10aa22dd45c10b7d7729f648dc8e65efb0d937ec (diff) | |
parent | 8027dcbc6f6b1653f5ebcf04b1862ac1e1f51d32 (diff) | |
download | nextcloud-server-f23c2162ad2d2883f08cc88c600a7d2ed4bd8a93.tar.gz nextcloud-server-f23c2162ad2d2883f08cc88c600a7d2ed4bd8a93.zip |
Merge pull request #23993 from nextcloud/bugfix/noid/close-cursors
Don't leave cursors open
Diffstat (limited to 'lib/private/legacy')
-rw-r--r-- | lib/private/legacy/OC_DB_StatementWrapper.php | 9 | ||||
-rw-r--r-- | lib/private/legacy/OC_Util.php | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/lib/private/legacy/OC_DB_StatementWrapper.php b/lib/private/legacy/OC_DB_StatementWrapper.php index 668e97c5650..64806cd205d 100644 --- a/lib/private/legacy/OC_DB_StatementWrapper.php +++ b/lib/private/legacy/OC_DB_StatementWrapper.php @@ -105,6 +105,15 @@ class OC_DB_StatementWrapper { } /** + * Closes the cursor, enabling the statement to be executed again. + * + * @deprecated Use Result::free() instead. + */ + public function closeCursor(): void { + $this->statement->closeCursor(); + } + + /** * Binds a PHP variable to a corresponding named or question mark placeholder in the * SQL statement that was use to prepare the statement. * diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index 80e43a0514a..66d8d95b52d 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -983,6 +983,7 @@ class OC_Util { try { $result = \OC_DB::executeAudited('SHOW SERVER_VERSION'); $data = $result->fetchRow(); + $result->closeCursor(); if (isset($data['server_version'])) { $version = $data['server_version']; if (version_compare($version, '9.0.0', '<')) { |