From f61b865ff7044e93dd52151905ab26d9faddc345 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Thu, 17 Nov 2022 17:06:11 +0100 Subject: [PATCH 1/5] Bump doctrine/dbal to 3.3 in master MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- 3rdparty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdparty b/3rdparty index 02ba5bba999b6..85380aa63d6fa 160000 --- a/3rdparty +++ b/3rdparty @@ -1 +1 @@ -Subproject commit 02ba5bba999b61d40c79a6ed56683b69edf66619 +Subproject commit 85380aa63d6faad636ed7e6ba869d8c5448488b9 From 9983af0cc056e7f2433523af76360bfe1acbfcf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Thu, 17 Nov 2022 17:12:14 +0100 Subject: [PATCH 2/5] Switch to new 3rdparty branch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- 3rdparty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdparty b/3rdparty index 85380aa63d6fa..84c0549ea4b3b 160000 --- a/3rdparty +++ b/3rdparty @@ -1 +1 @@ -Subproject commit 85380aa63d6faad636ed7e6ba869d8c5448488b9 +Subproject commit 84c0549ea4b3b058d747c9e5c4100834579a3c3b From 378630f8a092c9148d802b9662358346af2cef0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Mon, 21 Nov 2022 10:56:15 +0100 Subject: [PATCH 3/5] Fix psalm issues following doctrine/dbal bump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/private/DB/Connection.php | 7 ++++--- lib/private/DB/Migrator.php | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php index 73e0f4b4ac251..3173a65d87547 100644 --- a/lib/private/DB/Connection.php +++ b/lib/private/DB/Connection.php @@ -124,6 +124,7 @@ public function __construct( public function connect() { try { if ($this->_conn) { + /** @psalm-suppress InternalMethod */ return parent::connect(); } @@ -291,7 +292,7 @@ public function executeStatement($sql, array $params = [], array $types = []): i $sql = $this->adapter->fixupStatement($sql); $this->queriesExecuted++; $this->logQueryToFile($sql); - return parent::executeStatement($sql, $params, $types); + return (int)parent::executeStatement($sql, $params, $types); } protected function logQueryToFile(string $sql): void { @@ -390,7 +391,7 @@ public function setValues($table, array $keys, array $values, array $updatePreco return $insertQb->createNamedParameter($value, $this->getType($value)); }, array_merge($keys, $values)) ); - return $insertQb->execute(); + return $insertQb->executeStatement(); } catch (NotNullConstraintViolationException $e) { throw $e; } catch (ConstraintViolationException $e) { @@ -416,7 +417,7 @@ public function setValues($table, array $keys, array $values, array $updatePreco } } $updateQb->where($where); - $affected = $updateQb->execute(); + $affected = $updateQb->executeStatement(); if ($affected === 0 && !empty($updatePreconditionValues)) { throw new PreConditionNotMetException(); diff --git a/lib/private/DB/Migrator.php b/lib/private/DB/Migrator.php index 5dc07be1d2b26..97d91e1c1003a 100644 --- a/lib/private/DB/Migrator.php +++ b/lib/private/DB/Migrator.php @@ -41,7 +41,6 @@ use OCP\EventDispatcher\IEventDispatcher; class Migrator { - /** @var Connection */ protected $connection; @@ -138,6 +137,7 @@ protected function getDiff(Schema $targetSchema, Connection $connection) { } } + /** @psalm-suppress InternalMethod */ $comparator = new Comparator(); return $comparator->compare($sourceSchema, $targetSchema); } From 8a16e7e8a171d4f456fa70d25dfa85fb044d0029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Mon, 21 Nov 2022 11:30:20 +0100 Subject: [PATCH 4/5] Fix more psalm issues in OC\DB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- lib/private/DB/Connection.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php index 3173a65d87547..ceaffbcfa9a70 100644 --- a/lib/private/DB/Connection.php +++ b/lib/private/DB/Connection.php @@ -50,12 +50,13 @@ use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Statement; use OCP\DB\QueryBuilder\IQueryBuilder; +use OCP\Diagnostics\IEventLogger; use OCP\IRequestId; use OCP\PreConditionNotMetException; +use OCP\Profiler\IProfiler; use OC\DB\QueryBuilder\QueryBuilder; use OC\SystemConfig; use Psr\Log\LoggerInterface; -use OCP\Profiler\IProfiler; class Connection extends \Doctrine\DBAL\Connection { /** @var string */ @@ -129,8 +130,9 @@ public function connect() { } // Only trigger the event logger for the initial connect call - $eventLogger = \OC::$server->getEventLogger(); + $eventLogger = \OC::$server->get(IEventLogger::class); $eventLogger->start('connect:db', 'db connection opened'); + /** @psalm-suppress InternalMethod */ $status = parent::connect(); $eventLogger->end('connect:db'); From beaa81e420559396d1d8245a412af9427afd4e77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Tue, 22 Nov 2022 12:28:17 +0100 Subject: [PATCH 5/5] Align 3rdparty with master MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- 3rdparty | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/3rdparty b/3rdparty index 84c0549ea4b3b..fc9d6ab7f2e99 160000 --- a/3rdparty +++ b/3rdparty @@ -1 +1 @@ -Subproject commit 84c0549ea4b3b058d747c9e5c4100834579a3c3b +Subproject commit fc9d6ab7f2e990ebb09a9c322db6930a0a27444a