aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Comments/Manager.php13
-rw-r--r--lib/private/Files/Cache/Cache.php81
-rw-r--r--lib/private/Files/Cache/Storage.php6
-rw-r--r--lib/private/Files/Type/Loader.php9
-rw-r--r--lib/private/Repair/RepairDavShares.php24
-rw-r--r--lib/private/Share20/DefaultShareProvider.php60
-rw-r--r--lib/private/User/Database.php6
7 files changed, 98 insertions, 101 deletions
diff --git a/lib/private/Comments/Manager.php b/lib/private/Comments/Manager.php
index 41e0c662212..d7326a7a019 100644
--- a/lib/private/Comments/Manager.php
+++ b/lib/private/Comments/Manager.php
@@ -258,7 +258,6 @@ class Manager implements ICommentsManager {
throw new NotFoundException();
}
-
$comment = $this->getCommentFromData($data);
$this->cache($comment);
return $comment;
@@ -1278,7 +1277,7 @@ class Manager implements ICommentsManager {
->andWhere($qb->expr()->eq('actor_id', $qb->createParameter('id')))
->setParameter('type', $actorType)
->setParameter('id', $actorId)
- ->execute();
+ ->executeStatement();
$this->commentsCache = [];
@@ -1303,7 +1302,7 @@ class Manager implements ICommentsManager {
->andWhere($qb->expr()->eq('object_id', $qb->createParameter('id')))
->setParameter('type', $objectType)
->setParameter('id', $objectId)
- ->execute();
+ ->executeStatement();
$this->commentsCache = [];
@@ -1324,7 +1323,7 @@ class Manager implements ICommentsManager {
->setParameter('user_id', $user->getUID());
try {
- $affectedRows = $query->execute();
+ $affectedRows = $query->executeStatement();
} catch (DriverException $e) {
$this->logger->error($e->getMessage(), [
'exception' => $e,
@@ -1369,7 +1368,7 @@ class Manager implements ICommentsManager {
->setParameter('user_id', $user->getUID(), IQueryBuilder::PARAM_STR)
->setParameter('object_type', $objectType, IQueryBuilder::PARAM_STR)
->setParameter('object_id', $objectId, IQueryBuilder::PARAM_STR)
- ->execute();
+ ->executeStatement();
if ($affectedRows > 0) {
return;
@@ -1377,7 +1376,7 @@ class Manager implements ICommentsManager {
$qb->insert('comments_read_markers')
->values($values)
- ->execute();
+ ->executeStatement();
}
/**
@@ -1431,7 +1430,7 @@ class Manager implements ICommentsManager {
->setParameter('object_id', $objectId);
try {
- $affectedRows = $query->execute();
+ $affectedRows = $query->executeStatement();
} catch (DriverException $e) {
$this->logger->error($e->getMessage(), [
'exception' => $e,
diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php
index 9a6f7d41faa..adf118ad422 100644
--- a/lib/private/Files/Cache/Cache.php
+++ b/lib/private/Files/Cache/Cache.php
@@ -127,7 +127,7 @@ class Cache implements ICache {
}
$query->whereStorageId($this->getNumericStorageId());
- $result = $query->execute();
+ $result = $query->executeQuery();
$data = $result->fetch();
$result->closeCursor();
@@ -205,7 +205,7 @@ class Cache implements ICache {
$metadataQuery = $query->selectMetadata();
- $result = $query->execute();
+ $result = $query->executeQuery();
$files = $result->fetchAll();
$result->closeCursor();
@@ -294,7 +294,7 @@ class Cache implements ICache {
foreach ($extensionValues as $column => $value) {
$query->setValue($column, $query->createNamedParameter($value));
}
- $query->execute();
+ $query->executeStatement();
}
$event = new CacheEntryInsertedEvent($this->storage, $file, $fileId, $storageId);
@@ -320,19 +320,19 @@ class Cache implements ICache {
}
/**
- * update the metadata of an existing file or folder in the cache
+ * Update the metadata of an existing file or folder in the cache
*
- * @param int $id the fileid of the existing file or folder
- * @param array $data [$key => $value] the metadata to update, only the fields provided in the array will be updated, non-provided values will remain unchanged
+ * @param int $id The fileid of the existing file or folder
+ * @param array $data [$key => $value] The metadata to update, only the fields provided in the array will be updated, non-provided values will remain unchanged
*/
public function update($id, array $data) {
if (isset($data['path'])) {
- // normalize path
+ // Normalize path
$data['path'] = $this->normalize($data['path']);
}
if (isset($data['name'])) {
- // normalize path
+ // Normalize name
$data['name'] = $this->normalize($data['name']);
}
@@ -355,22 +355,21 @@ class Cache implements ICache {
$query->set($key, $query->createNamedParameter($value));
}
- $query->execute();
+ $query->executeStatement();
}
if (count($extensionValues)) {
- try {
- $query = $this->getQueryBuilder();
- $query->insert('filecache_extended');
- $query->hintShardKey('storage', $this->getNumericStorageId());
+ // Check if the record already exists
+ $query = $this->getQueryBuilder();
+ $query->select('fileid')
+ ->from('filecache_extended')
+ ->whereFileId($id)
+ ->setMaxResults(1);
- $query->setValue('fileid', $query->createNamedParameter($id, IQueryBuilder::PARAM_INT));
- foreach ($extensionValues as $column => $value) {
- $query->setValue($column, $query->createNamedParameter($value));
- }
+ $result = $query->executeQuery()->fetchOne();
- $query->execute();
- } catch (UniqueConstraintViolationException $e) {
+ if ($result) {
+ // Record exists, perform an update
$query = $this->getQueryBuilder();
$query->update('filecache_extended')
->whereFileId($id)
@@ -386,7 +385,19 @@ class Cache implements ICache {
$query->set($key, $query->createNamedParameter($value));
}
- $query->execute();
+ $query->executeStatement();
+ } else {
+ // Record does not exist, perform an insert
+ $query = $this->getQueryBuilder();
+ $query->insert('filecache_extended');
+ $query->hintShardKey('storage', $this->getNumericStorageId());
+
+ $query->setValue('fileid', $query->createNamedParameter($id, IQueryBuilder::PARAM_INT));
+ foreach ($extensionValues as $column => $value) {
+ $query->setValue($column, $query->createNamedParameter($value));
+ }
+
+ $query->executeStatement();
}
}
@@ -468,7 +479,7 @@ class Cache implements ICache {
->whereStorageId($this->getNumericStorageId())
->wherePath($file);
- $result = $query->execute();
+ $result = $query->executeQuery();
$id = $result->fetchOne();
$result->closeCursor();
@@ -523,13 +534,13 @@ class Cache implements ICache {
$query->delete('filecache')
->whereStorageId($this->getNumericStorageId())
->whereFileId($entry->getId());
- $query->execute();
+ $query->executeStatement();
$query = $this->getQueryBuilder();
$query->delete('filecache_extended')
->whereFileId($entry->getId())
->hintShardKey('storage', $this->getNumericStorageId());
- $query->execute();
+ $query->executeStatement();
if ($entry->getMimeType() == FileInfo::MIMETYPE_FOLDER) {
$this->removeChildren($entry);
@@ -577,7 +588,7 @@ class Cache implements ICache {
foreach (array_chunk($childIds, 1000) as $childIdChunk) {
$query->setParameter('childIds', $childIdChunk, IQueryBuilder::PARAM_INT_ARRAY);
- $query->execute();
+ $query->executeStatement();
}
/** @var ICacheEntry[] $childFolders */
@@ -603,7 +614,7 @@ class Cache implements ICache {
sort($parentIds, SORT_NUMERIC);
foreach (array_chunk($parentIds, 1000) as $parentIdChunk) {
$query->setParameter('parentIds', $parentIdChunk, IQueryBuilder::PARAM_INT_ARRAY);
- $query->execute();
+ $query->executeStatement();
}
foreach (array_combine($deletedIds, $deletedPaths) as $fileId => $filePath) {
@@ -765,7 +776,7 @@ class Cache implements ICache {
$query->set('encrypted', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT));
}
- $query->execute();
+ $query->executeStatement();
$this->connection->commit();
@@ -800,12 +811,12 @@ class Cache implements ICache {
$query = $this->getQueryBuilder();
$query->delete('filecache')
->whereStorageId($this->getNumericStorageId());
- $query->execute();
+ $query->executeStatement();
$query = $this->connection->getQueryBuilder();
$query->delete('storages')
->where($query->expr()->eq('id', $query->createNamedParameter($this->storageId)));
- $query->execute();
+ $query->executeStatement();
}
/**
@@ -830,7 +841,7 @@ class Cache implements ICache {
->whereStorageId($this->getNumericStorageId())
->wherePath($file);
- $result = $query->execute();
+ $result = $query->executeQuery();
$size = $result->fetchOne();
$result->closeCursor();
@@ -919,7 +930,7 @@ class Cache implements ICache {
->whereStorageId($this->getNumericStorageId())
->andWhere($query->expr()->lt('size', $query->createNamedParameter(0, IQueryBuilder::PARAM_INT)));
- $result = $query->execute();
+ $result = $query->executeQuery();
$size = (int)$result->fetchOne();
$result->closeCursor();
@@ -965,7 +976,7 @@ class Cache implements ICache {
$query->andWhere($query->expr()->gte('size', $query->createNamedParameter(0)));
}
- $result = $query->execute();
+ $result = $query->executeQuery();
$rows = $result->fetchAll();
$result->closeCursor();
@@ -1039,7 +1050,7 @@ class Cache implements ICache {
->from('filecache')
->whereStorageId($this->getNumericStorageId());
- $result = $query->execute();
+ $result = $query->executeQuery();
$files = $result->fetchAll(\PDO::FETCH_COLUMN);
$result->closeCursor();
@@ -1070,7 +1081,7 @@ class Cache implements ICache {
->orderBy('fileid', 'DESC')
->setMaxResults(1);
- $result = $query->execute();
+ $result = $query->executeQuery();
$id = $result->fetchOne();
$result->closeCursor();
@@ -1095,7 +1106,7 @@ class Cache implements ICache {
->whereStorageId($this->getNumericStorageId())
->whereFileId($id);
- $result = $query->execute();
+ $result = $query->executeQuery();
$path = $result->fetchOne();
$result->closeCursor();
@@ -1121,7 +1132,7 @@ class Cache implements ICache {
->from('filecache')
->where($query->expr()->eq('fileid', $query->createNamedParameter($id, IQueryBuilder::PARAM_INT)));
- $result = $query->execute();
+ $result = $query->executeQuery();
$row = $result->fetch();
$result->closeCursor();
diff --git a/lib/private/Files/Cache/Storage.php b/lib/private/Files/Cache/Storage.php
index 8d99a268dc0..edd259fa18f 100644
--- a/lib/private/Files/Cache/Storage.php
+++ b/lib/private/Files/Cache/Storage.php
@@ -157,7 +157,7 @@ class Storage {
->set('available', $query->createNamedParameter($available))
->set('last_checked', $query->createNamedParameter(time() + $delay))
->where($query->expr()->eq('id', $query->createNamedParameter($this->storageId)));
- $query->execute();
+ $query->executeStatement();
}
/**
@@ -182,13 +182,13 @@ class Storage {
$query = \OC::$server->getDatabaseConnection()->getQueryBuilder();
$query->delete('storages')
->where($query->expr()->eq('id', $query->createNamedParameter($storageId)));
- $query->execute();
+ $query->executeStatement();
if (!is_null($numericId)) {
$query = \OC::$server->getDatabaseConnection()->getQueryBuilder();
$query->delete('filecache')
->where($query->expr()->eq('storage', $query->createNamedParameter($numericId)));
- $query->execute();
+ $query->executeStatement();
}
}
diff --git a/lib/private/Files/Type/Loader.php b/lib/private/Files/Type/Loader.php
index 407df59b2e2..5fbe4139759 100644
--- a/lib/private/Files/Type/Loader.php
+++ b/lib/private/Files/Type/Loader.php
@@ -21,8 +21,6 @@ use OCP\IDBConnection;
class Loader implements IMimeTypeLoader {
use TTransactional;
- private IDBConnection $dbConnection;
-
/** @psalm-var array<int, string> */
protected array $mimetypes;
@@ -32,8 +30,9 @@ class Loader implements IMimeTypeLoader {
/**
* @param IDBConnection $dbConnection
*/
- public function __construct(IDBConnection $dbConnection) {
- $this->dbConnection = $dbConnection;
+ public function __construct(
+ private IDBConnection $dbConnection,
+ ) {
$this->mimetypes = [];
$this->mimetypeIds = [];
}
@@ -161,6 +160,6 @@ class Loader implements IMimeTypeLoader {
$update->func()->lower('name'),
$update->createNamedParameter('%' . $this->dbConnection->escapeLikeParameter('.' . $ext))
));
- return $update->execute();
+ return $update->executeStatement();
}
}
diff --git a/lib/private/Repair/RepairDavShares.php b/lib/private/Repair/RepairDavShares.php
index 36e3c397a39..8199d3dff27 100644
--- a/lib/private/Repair/RepairDavShares.php
+++ b/lib/private/Repair/RepairDavShares.php
@@ -23,27 +23,15 @@ use function urlencode;
class RepairDavShares implements IRepairStep {
protected const GROUP_PRINCIPAL_PREFIX = 'principals/groups/';
- /** @var IConfig */
- private $config;
- /** @var IDBConnection */
- private $dbc;
- /** @var IGroupManager */
- private $groupManager;
- /** @var LoggerInterface */
- private $logger;
/** @var bool */
private $hintInvalidShares = false;
public function __construct(
- IConfig $config,
- IDBConnection $dbc,
- IGroupManager $groupManager,
- LoggerInterface $logger,
+ private IConfig $config,
+ private IDBConnection $dbc,
+ private IGroupManager $groupManager,
+ private LoggerInterface $logger,
) {
- $this->config = $config;
- $this->dbc = $dbc;
- $this->groupManager = $groupManager;
- $this->logger = $logger;
}
/**
@@ -64,7 +52,7 @@ class RepairDavShares implements IRepairStep {
->set('principaluri', $updateQuery->createParameter('updatedPrincipalUri'))
->where($updateQuery->expr()->eq('id', $updateQuery->createParameter('shareId')));
- $statement = $qb->execute();
+ $statement = $qb->executeQuery();
while ($share = $statement->fetch()) {
$gid = substr($share['principaluri'], strlen(self::GROUP_PRINCIPAL_PREFIX));
$decodedGid = urldecode($gid);
@@ -93,7 +81,7 @@ class RepairDavShares implements IRepairStep {
$updateQuery
->setParameter('updatedPrincipalUri', $fixedPrincipal)
->setParameter('shareId', $share['id'])
- ->execute();
+ ->executeStatement();
$this->logger->info('Repaired principal for dav share {id} from {old} to {new}', $logParameters);
} catch (Exception $e) {
$logParameters['message'] = $e->getMessage();
diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php
index af993b7f314..07bdbe03275 100644
--- a/lib/private/Share20/DefaultShareProvider.php
+++ b/lib/private/Share20/DefaultShareProvider.php
@@ -226,7 +226,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
->set('note', $qb->createNamedParameter($share->getNote()))
->set('accepted', $qb->createNamedParameter($share->getStatus()))
->set('reminder_sent', $qb->createNamedParameter($share->getReminderSent(), IQueryBuilder::PARAM_BOOL))
- ->execute();
+ ->executeStatement();
} elseif ($share->getShareType() === IShare::TYPE_GROUP) {
$qb = $this->dbConn->getQueryBuilder();
$qb->update('share')
@@ -239,7 +239,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
->set('file_source', $qb->createNamedParameter($share->getNode()->getId()))
->set('expiration', $qb->createNamedParameter($expirationDate, IQueryBuilder::PARAM_DATE))
->set('note', $qb->createNamedParameter($share->getNote()))
- ->execute();
+ ->executeStatement();
/*
* Update all user defined group shares
@@ -254,7 +254,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
->set('file_source', $qb->createNamedParameter($share->getNode()->getId()))
->set('expiration', $qb->createNamedParameter($expirationDate, IQueryBuilder::PARAM_DATE))
->set('note', $qb->createNamedParameter($share->getNote()))
- ->execute();
+ ->executeStatement();
/*
* Now update the permissions for all children that have not set it to 0
@@ -265,7 +265,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
->andWhere($qb->expr()->neq('permissions', $qb->createNamedParameter(0)))
->set('permissions', $qb->createNamedParameter($share->getPermissions()))
->set('attributes', $qb->createNamedParameter($shareAttributes))
- ->execute();
+ ->executeStatement();
} elseif ($share->getShareType() === IShare::TYPE_LINK) {
$qb = $this->dbConn->getQueryBuilder();
$qb->update('share')
@@ -283,7 +283,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
->set('note', $qb->createNamedParameter($share->getNote()))
->set('label', $qb->createNamedParameter($share->getLabel()))
->set('hide_download', $qb->createNamedParameter($share->getHideDownload() ? 1 : 0), IQueryBuilder::PARAM_INT)
- ->execute();
+ ->executeStatement();
}
if ($originalShare->getNote() !== $share->getNote() && $share->getNote() !== '') {
@@ -326,7 +326,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->expr()->eq('item_type', $qb->createNamedParameter('file')),
$qb->expr()->eq('item_type', $qb->createNamedParameter('folder'))
))
- ->execute();
+ ->executeQuery();
$data = $stmt->fetch();
$stmt->closeCursor();
@@ -354,7 +354,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->update('share')
->set('accepted', $qb->createNamedParameter(IShare::STATUS_ACCEPTED))
->where($qb->expr()->eq('id', $qb->createNamedParameter($id)))
- ->execute();
+ ->executeStatement();
return $share;
}
@@ -389,7 +389,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
))
->orderBy('id');
- $cursor = $qb->execute();
+ $cursor = $qb->executeQuery();
while ($data = $cursor->fetch()) {
$children[] = $this->createShare($data);
}
@@ -416,7 +416,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->orWhere($qb->expr()->eq('parent', $qb->createNamedParameter($share->getId())));
}
- $qb->execute();
+ $qb->executeStatement();
}
/**
@@ -453,7 +453,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->expr()->eq('item_type', $qb->createNamedParameter('file')),
$qb->expr()->eq('item_type', $qb->createNamedParameter('folder'))
))
- ->execute();
+ ->executeQuery();
$data = $stmt->fetch();
@@ -475,7 +475,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->update('share')
->set('permissions', $qb->createNamedParameter(0))
->where($qb->expr()->eq('id', $qb->createNamedParameter($id)))
- ->execute();
+ ->executeStatement();
}
} elseif ($share->getShareType() === IShare::TYPE_USER) {
if ($share->getSharedWith() !== $recipient) {
@@ -506,7 +506,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
'file_target' => $qb->createNamedParameter($share->getTarget()),
'permissions' => $qb->createNamedParameter($share->getPermissions()),
'stime' => $qb->createNamedParameter($share->getShareTime()->getTimestamp()),
- ])->execute();
+ ])->executeStatement();
return $qb->getLastInsertId();
}
@@ -524,7 +524,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
->where(
$qb->expr()->eq('id', $qb->createNamedParameter($share->getId()))
);
- $cursor = $qb->execute();
+ $cursor = $qb->executeQuery();
$data = $cursor->fetch();
$cursor->closeCursor();
@@ -541,7 +541,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->expr()->eq('share_with', $qb->createNamedParameter($recipient))
);
- $qb->execute();
+ $qb->executeStatement();
return $this->getShareById($share->getId(), $recipient);
}
@@ -556,7 +556,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->update('share')
->set('file_target', $qb->createNamedParameter($share->getTarget()))
->where($qb->expr()->eq('id', $qb->createNamedParameter($share->getId())))
- ->execute();
+ ->executeStatement();
} elseif ($share->getShareType() === IShare::TYPE_GROUP) {
// Check if there is a usergroup share
$qb = $this->dbConn->getQueryBuilder();
@@ -570,7 +570,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->expr()->eq('item_type', $qb->createNamedParameter('folder'))
))
->setMaxResults(1)
- ->execute();
+ ->executeQuery();
$data = $stmt->fetch();
$stmt->closeCursor();
@@ -596,14 +596,14 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
'permissions' => $qb->createNamedParameter($share->getPermissions()),
'attributes' => $qb->createNamedParameter($shareAttributes),
'stime' => $qb->createNamedParameter($share->getShareTime()->getTimestamp()),
- ])->execute();
+ ])->executeStatement();
} else {
// Already a usergroup share. Update it.
$qb = $this->dbConn->getQueryBuilder();
$qb->update('share')
->set('file_target', $qb->createNamedParameter($share->getTarget()))
->where($qb->expr()->eq('id', $qb->createNamedParameter($data['id'])))
- ->execute();
+ ->executeStatement();
}
}
@@ -727,7 +727,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->setFirstResult($offset);
$qb->orderBy('id');
- $cursor = $qb->execute();
+ $cursor = $qb->executeQuery();
$shares = [];
while ($data = $cursor->fetch()) {
$shares[] = $this->createShare($data);
@@ -761,7 +761,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->expr()->eq('item_type', $qb->createNamedParameter('folder'))
));
- $cursor = $qb->execute();
+ $cursor = $qb->executeQuery();
$data = $cursor->fetch();
$cursor->closeCursor();
@@ -805,7 +805,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->expr()->eq('item_type', $qb->createNamedParameter('file')),
$qb->expr()->eq('item_type', $qb->createNamedParameter('folder'))
))
- ->execute();
+ ->executeQuery();
$shares = [];
while ($data = $cursor->fetch()) {
@@ -882,7 +882,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->andWhere($qb->expr()->eq('file_source', $qb->createNamedParameter($node->getId())));
}
- $cursor = $qb->execute();
+ $cursor = $qb->executeQuery();
while ($data = $cursor->fetch()) {
if ($data['fileid'] && $data['path'] === null) {
@@ -946,7 +946,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->expr()->eq('item_type', $qb->createNamedParameter('folder'))
));
- $cursor = $qb->execute();
+ $cursor = $qb->executeQuery();
while ($data = $cursor->fetch()) {
if ($offset > 0) {
$offset--;
@@ -1099,7 +1099,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$query->andWhere($qb->expr()->eq('parent', $qb->createNamedParameter($share->getId())));
}
- $stmt = $query->execute();
+ $stmt = $query->executeQuery();
while ($data = $stmt->fetch()) {
if (array_key_exists($data['parent'], $shareMap)) {
@@ -1179,7 +1179,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
return;
}
- $qb->execute();
+ $qb->executeStatement();
}
/**
@@ -1198,7 +1198,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
->where($qb->expr()->eq('share_type', $qb->createNamedParameter(IShare::TYPE_GROUP)))
->andWhere($qb->expr()->eq('share_with', $qb->createNamedParameter($gid)));
- $cursor = $qb->execute();
+ $cursor = $qb->executeQuery();
$ids = [];
while ($row = $cursor->fetch()) {
$ids[] = (int)$row['id'];
@@ -1215,7 +1215,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
foreach ($chunks as $chunk) {
$qb->setParameter('parents', $chunk, IQueryBuilder::PARAM_INT_ARRAY);
- $qb->execute();
+ $qb->executeStatement();
}
}
@@ -1226,7 +1226,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->delete('share')
->where($qb->expr()->eq('share_type', $qb->createNamedParameter(IShare::TYPE_GROUP)))
->andWhere($qb->expr()->eq('share_with', $qb->createNamedParameter($gid)));
- $qb->execute();
+ $qb->executeStatement();
}
/**
@@ -1342,7 +1342,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
$qb->expr()->eq('item_type', $qb->createNamedParameter('file')),
$qb->expr()->eq('item_type', $qb->createNamedParameter('folder'))
));
- $cursor = $qb->execute();
+ $cursor = $qb->executeQuery();
$users = [];
$link = false;
@@ -1659,7 +1659,7 @@ class DefaultShareProvider implements IShareProviderWithNotification, IShareProv
)
);
- $cursor = $qb->execute();
+ $cursor = $qb->executeQuery();
while ($data = $cursor->fetch()) {
try {
$share = $this->createShare($data);
diff --git a/lib/private/User/Database.php b/lib/private/User/Database.php
index 2d3808e9dc7..99ff426067b 100644
--- a/lib/private/User/Database.php
+++ b/lib/private/User/Database.php
@@ -130,7 +130,7 @@ class Database extends ABackend implements
$query = $this->dbConn->getQueryBuilder();
$query->delete($this->table)
->where($query->expr()->eq('uid_lower', $query->createNamedParameter(mb_strtolower($uid))));
- $result = $query->execute();
+ $result = $query->executeStatement();
if (isset($this->cache[$uid])) {
unset($this->cache[$uid]);
@@ -144,7 +144,7 @@ class Database extends ABackend implements
$query->update($this->table)
->set('password', $query->createNamedParameter($passwordHash))
->where($query->expr()->eq('uid_lower', $query->createNamedParameter(mb_strtolower($uid))));
- $result = $query->execute();
+ $result = $query->executeStatement();
return $result ? true : false;
}
@@ -236,7 +236,7 @@ class Database extends ABackend implements
$query->update($this->table)
->set('displayname', $query->createNamedParameter($displayName))
->where($query->expr()->eq('uid_lower', $query->createNamedParameter(mb_strtolower($uid))));
- $query->execute();
+ $query->executeStatement();
$this->cache[$uid]['displayname'] = $displayName;