Merge branch '3.4' into 4.4

* 3.4:
  [Cache] fix compat with doctrine/dbal v3
This commit is contained in:
Nicolas Grekas 2020-06-09 13:52:05 +02:00
commit 1c328c64ad
1 changed files with 4 additions and 4 deletions

View File

@ -364,19 +364,19 @@ trait PdoTrait
foreach ($values as $id => $data) { foreach ($values as $id => $data) {
try { try {
$stmt->execute(); $result = $stmt->execute();
} catch (TableNotFoundException $e) { } catch (TableNotFoundException $e) {
if (!$conn->isTransactionActive() || \in_array($this->driver, ['pgsql', 'sqlite', 'sqlsrv'], true)) { if (!$conn->isTransactionActive() || \in_array($this->driver, ['pgsql', 'sqlite', 'sqlsrv'], true)) {
$this->createTable(); $this->createTable();
} }
$stmt->execute(); $result = $stmt->execute();
} catch (\PDOException $e) { } catch (\PDOException $e) {
if (!$conn->inTransaction() || \in_array($this->driver, ['pgsql', 'sqlite', 'sqlsrv'], true)) { if (!$conn->inTransaction() || \in_array($this->driver, ['pgsql', 'sqlite', 'sqlsrv'], true)) {
$this->createTable(); $this->createTable();
} }
$stmt->execute(); $result = $stmt->execute();
} }
if (null === $driver && !$stmt->rowCount()) { if (null === $driver && !($result instanceof Result ? $result : $stmt)->rowCount()) {
try { try {
$insertStmt->execute(); $insertStmt->execute();
} catch (DBALException $e) { } catch (DBALException $e) {