Skip to content

Commit d1a912e

Browse files
arifsznnicolas-grekas
authored andcommitted
[Cache][Lock] Identify missing table in pgsql correctly and address failing integration tests
1 parent 116c7c5 commit d1a912e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Store/PdoStore.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,10 +330,10 @@ private function getCurrentTimestampStatement(): string
330330
private function isTableMissing(\PDOException $exception): bool
331331
{
332332
$driver = $this->getDriver();
333-
$code = $exception->errorInfo ? $exception->errorInfo[1] : $exception->getCode();
333+
[$sqlState, $code] = $exception->errorInfo ?? [null, $exception->getCode()];
334334

335335
switch (true) {
336-
case 'pgsql' === $driver && '42P01' === $code:
336+
case 'pgsql' === $driver && '42P01' === $sqlState:
337337
case 'sqlite' === $driver && str_contains($exception->getMessage(), 'no such table:'):
338338
case 'oci' === $driver && 942 === $code:
339339
case 'sqlsrv' === $driver && 208 === $code:

0 commit comments

Comments
 (0)