aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Type
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-11-05 10:50:53 +0100
committerJoas Schilling <coding@schilljs.com>2020-11-09 12:28:17 +0100
commit8027dcbc6f6b1653f5ebcf04b1862ac1e1f51d32 (patch)
tree1bf182f477bfbead7b75ae14a8cd0fce5bb38ada /lib/private/Files/Type
parent72545ffd07a07f142c9c18b3e4afc9ae1b5c8da2 (diff)
downloadnextcloud-server-8027dcbc6f6b1653f5ebcf04b1862ac1e1f51d32.tar.gz
nextcloud-server-8027dcbc6f6b1653f5ebcf04b1862ac1e1f51d32.zip
Don't leave cursors open when tests fail
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Files/Type')
-rw-r--r--lib/private/Files/Type/Loader.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/private/Files/Type/Loader.php b/lib/private/Files/Type/Loader.php
index d128bc724b6..489ed65c228 100644
--- a/lib/private/Files/Type/Loader.php
+++ b/lib/private/Files/Type/Loader.php
@@ -123,7 +123,10 @@ class Loader implements IMimeTypeLoader {
->where(
$fetch->expr()->eq('mimetype', $fetch->createNamedParameter($mimetype)
));
- $row = $fetch->execute()->fetch();
+
+ $result = $fetch->execute();
+ $row = $result->fetch();
+ $result->closeCursor();
if (!$row) {
throw new \Exception("Failed to get mimetype id for $mimetype after trying to store it");
@@ -141,7 +144,10 @@ class Loader implements IMimeTypeLoader {
$qb = $this->dbConnection->getQueryBuilder();
$qb->select('id', 'mimetype')
->from('mimetypes');
- $results = $qb->execute()->fetchAll();
+
+ $result = $qb->execute();
+ $results = $result->fetchAll();
+ $result->closeCursor();
foreach ($results as $row) {
$this->mimetypes[$row['id']] = $row['mimetype'];