From d6e902fd039eca0a41adbe0d45590ec604919644 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Mon, 24 Jul 2017 18:05:08 +0200 Subject: [PATCH] Fix last failures with oracle Signed-off-by: Joas Schilling --- lib/private/Share/Share.php | 6 ++++-- tests/lib/Repair/NC12/UpdateLanguageCodesTest.php | 3 ++- tests/lib/Share/ShareTest.php | 8 ++++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/lib/private/Share/Share.php b/lib/private/Share/Share.php index dc96d856ba6..58f44255d9a 100644 --- a/lib/private/Share/Share.php +++ b/lib/private/Share/Share.php @@ -338,6 +338,7 @@ class Share extends Constants { } } } + $result->closeCursor(); } } @@ -1461,8 +1462,9 @@ class Share extends Constants { ->from('share') ->where($qb->expr()->eq('id', $qb->createParameter('shareId'))) ->setParameter(':shareId', $shareId); - $result = $qb->execute(); - $result = $result->fetch(); + $dbResult = $qb->execute(); + $result = $dbResult->fetch(); + $dbResult->closeCursor(); if (empty($result)) { throw new \Exception('Share not found'); diff --git a/tests/lib/Repair/NC12/UpdateLanguageCodesTest.php b/tests/lib/Repair/NC12/UpdateLanguageCodesTest.php index 4379d1ba589..46422589541 100644 --- a/tests/lib/Repair/NC12/UpdateLanguageCodesTest.php +++ b/tests/lib/Repair/NC12/UpdateLanguageCodesTest.php @@ -24,6 +24,7 @@ namespace Test\Repair\NC12; use OC\Repair\NC12\UpdateLanguageCodes; +use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IConfig; use OCP\Migration\IOutput; use Test\TestCase; @@ -152,7 +153,7 @@ class UpdateLanguageCodesTest extends TestCase { ->where($qb->expr()->eq('userid', $qb->createNamedParameter($user['userid']))) ->andWhere($qb->expr()->eq('appid', $qb->createNamedParameter('core'))) ->andWhere($qb->expr()->eq('configkey', $qb->createNamedParameter('lang'))) - ->andWhere($qb->expr()->eq('configvalue', $qb->createNamedParameter($user['configvalue']))) + ->andWhere($qb->expr()->eq('configvalue', $qb->createNamedParameter($user['configvalue']), IQueryBuilder::PARAM_STR)) ->execute(); } } diff --git a/tests/lib/Share/ShareTest.php b/tests/lib/Share/ShareTest.php index 40e88d597a4..4ce40a2accd 100644 --- a/tests/lib/Share/ShareTest.php +++ b/tests/lib/Share/ShareTest.php @@ -1246,7 +1246,9 @@ class ShareTest extends \Test\TestCase { ->setParameter('owner', $this->user1->getUID()) ->setParameter('share_type', \OCP\Share::SHARE_TYPE_LINK); - $res = $qb->execute()->fetchAll(); + $result = $qb->execute(); + $res = $result->fetchAll(); + $result->closeCursor(); $this->assertCount(1, $res); $id = $res[0]['id']; @@ -1260,7 +1262,9 @@ class ShareTest extends \Test\TestCase { ->from('share') ->where($qb->expr()->eq('id', $qb->createParameter('id'))) ->setParameter('id', $id); - $hash = $qb->execute()->fetch()['share_with']; + $result = $qb->execute(); + $hash = $result->fetch()['share_with']; + $result->closeCursor(); $hasher = \OC::$server->getHasher(); -- 2.39.5