diff --git a/apps/testing/lib/Locking/FakeDBLockingProvider.php b/apps/testing/lib/Locking/FakeDBLockingProvider.php index f77bacc7a6355..6792c6543c3ce 100644 --- a/apps/testing/lib/Locking/FakeDBLockingProvider.php +++ b/apps/testing/lib/Locking/FakeDBLockingProvider.php @@ -9,7 +9,9 @@ use OC\Lock\DBLockingProvider; use OCP\AppFramework\Utility\ITimeFactory; +use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; +use Override; class FakeDBLockingProvider extends DBLockingProvider { // Lock for 10 hours just to be sure @@ -28,14 +30,16 @@ public function __construct( $this->db = $connection; } - /** @inheritDoc */ + #[Override] public function releaseLock(string $path, int $type): void { - // we DONT keep shared locks till the end of the request + // we DON'T keep shared locks till the end of the request if ($type === self::LOCK_SHARED) { - $this->db->executeUpdate( - 'UPDATE `*PREFIX*file_locks` SET `lock` = 0 WHERE `key` = ? AND `lock` = 1', - [$path] - ); + $qb = $this->db->getQueryBuilder(); + $qb->update('file_locks') + ->set('lock', $qb->createNamedParameter(0, IQueryBuilder::PARAM_INT)) + ->where($qb->expr()->eq('key', $qb->createNamedParameter($path, IQueryBuilder::PARAM_STR))) + ->andWhere($qb->expr()->eq('lock', $qb->createNamedParameter(1, IQueryBuilder::PARAM_INT))) + ->executeStatement(); } parent::releaseLock($path, $type); diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index df8b4d89e8bec..bb1487798c8f7 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -2132,11 +2132,6 @@ - - - - - @@ -2674,7 +2669,6 @@ - @@ -3021,34 +3015,6 @@ request->server]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/core/Command/Db/ConvertType.php b/core/Command/Db/ConvertType.php index 0067bec4d9e30..e09f803f3c81e 100644 --- a/core/Command/Db/ConvertType.php +++ b/core/Command/Db/ConvertType.php @@ -358,7 +358,7 @@ protected function copyTable(Connection $fromDB, Connection $toDB, Table $table, $insertQuery->setParameter($key, $value); } } - $insertQuery->execute(); + $insertQuery->executeStatement(); } $result->closeCursor(); diff --git a/core/Migrations/Version13000Date20170718121200.php b/core/Migrations/Version13000Date20170718121200.php index 35c2d1730bc4c..ed8c57f52e5d2 100644 --- a/core/Migrations/Version13000Date20170718121200.php +++ b/core/Migrations/Version13000Date20170718121200.php @@ -31,7 +31,7 @@ public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array if ($table->hasColumn('fileid')) { $qb = $this->connection->getQueryBuilder(); $qb->delete('properties'); - $qb->execute(); + $qb->executeStatement(); } } @@ -1008,6 +1008,7 @@ public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $query = $this->connection->getQueryBuilder(); $query->select('*') ->from('dav_properties'); + $result = $query->executeQuery(); $insert = $this->connection->getQueryBuilder(); $insert->insert('properties') @@ -1016,14 +1017,13 @@ public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array ->setValue('propertyvalue', $insert->createParameter('propertyvalue')) ->setValue('userid', $insert->createParameter('userid')); - $result = $query->execute(); while ($row = $result->fetch()) { preg_match('/(calendar)\/([A-z0-9-@_]+)\//', $row['propertypath'], $match); $insert->setParameter('propertypath', (string)$row['propertypath']) ->setParameter('propertyname', (string)$row['propertyname']) ->setParameter('propertyvalue', (string)$row['propertyvalue']) ->setParameter('userid', ($match[2] ?? '')); - $insert->execute(); + $insert->executeStatement(); } } } diff --git a/core/Migrations/Version14000Date20180404140050.php b/core/Migrations/Version14000Date20180404140050.php index cb7723285df35..6f477f7fcdc64 100644 --- a/core/Migrations/Version14000Date20180404140050.php +++ b/core/Migrations/Version14000Date20180404140050.php @@ -62,6 +62,6 @@ public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $qb->update('users') ->set('uid_lower', $qb->func()->lower('uid')); - $qb->execute(); + $qb->executeStatement(); } } diff --git a/core/Migrations/Version16000Date20190427105638.php b/core/Migrations/Version16000Date20190427105638.php index 3664485e83c1f..98a81e1a2ff47 100644 --- a/core/Migrations/Version16000Date20190427105638.php +++ b/core/Migrations/Version16000Date20190427105638.php @@ -29,7 +29,7 @@ public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $ $this->connection ->getQueryBuilder() ->delete('collres_accesscache') - ->execute(); + ->executeStatement(); } /** diff --git a/core/Migrations/Version18000Date20190920085628.php b/core/Migrations/Version18000Date20190920085628.php index 6ba05838d86c7..ed48792d694a0 100644 --- a/core/Migrations/Version18000Date20190920085628.php +++ b/core/Migrations/Version18000Date20190920085628.php @@ -55,6 +55,6 @@ public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $query = $this->connection->getQueryBuilder(); $query->update('groups') ->set('displayname', 'gid'); - $query->execute(); + $query->executeStatement(); } } diff --git a/core/Migrations/Version20000Date20201109081918.php b/core/Migrations/Version20000Date20201109081918.php index a24b1ab82b4e6..f85c34f47a2af 100644 --- a/core/Migrations/Version20000Date20201109081918.php +++ b/core/Migrations/Version20000Date20201109081918.php @@ -77,12 +77,12 @@ public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array ->setValue('identifier', $insert->createParameter('identifier')) ->setValue('credentials', $insert->createParameter('credentials')); - $result = $query->execute(); + $result = $query->executeQuery(); while ($row = $result->fetch()) { $insert->setParameter('user', (string)$row['user']) ->setParameter('identifier', (string)$row['identifier']) ->setParameter('credentials', (string)$row['credentials']); - $insert->execute(); + $insert->executeStatement(); } $result->closeCursor(); }