aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
m---------3rdparty0
-rw-r--r--lib/private/DB/Connection.php13
-rw-r--r--lib/private/DB/Migrator.php2
3 files changed, 9 insertions, 6 deletions
diff --git a/3rdparty b/3rdparty
-Subproject 02ba5bba999b61d40c79a6ed56683b69edf6661
+Subproject fc9d6ab7f2e990ebb09a9c322db6930a0a27444
diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php
index 73e0f4b4ac2..ceaffbcfa9a 100644
--- a/lib/private/DB/Connection.php
+++ b/lib/private/DB/Connection.php
@@ -50,12 +50,13 @@ use Doctrine\DBAL\Result;
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 */
@@ -124,12 +125,14 @@ class Connection extends \Doctrine\DBAL\Connection {
public function connect() {
try {
if ($this->_conn) {
+ /** @psalm-suppress InternalMethod */
return parent::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');
@@ -291,7 +294,7 @@ class Connection extends \Doctrine\DBAL\Connection {
$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 +393,7 @@ class Connection extends \Doctrine\DBAL\Connection {
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 +419,7 @@ class Connection extends \Doctrine\DBAL\Connection {
}
}
$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 5dc07be1d2b..97d91e1c100 100644
--- a/lib/private/DB/Migrator.php
+++ b/lib/private/DB/Migrator.php
@@ -41,7 +41,6 @@ use function preg_match;
use OCP\EventDispatcher\IEventDispatcher;
class Migrator {
-
/** @var Connection */
protected $connection;
@@ -138,6 +137,7 @@ class Migrator {
}
}
+ /** @psalm-suppress InternalMethod */
$comparator = new Comparator();
return $comparator->compare($sourceSchema, $targetSchema);
}