Skip to content

Commit

Permalink
[Lock] Check the correct SQLSTATE error code for MySQL
Browse files Browse the repository at this point in the history
* Closes bug: #54091

Signed-off-by: Ernesto Domato <edomato@gmail.com>
  • Loading branch information
edomato authored and nicolas-grekas committed Mar 13, 2024
1 parent 7dae80d commit 7318816
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Symfony/Component/Cache/Adapter/PdoAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ private function getServerVersion(): string
private function isTableMissing(\PDOException $exception): bool
{
$driver = $this->driver;
$code = $exception->getCode();
$code = $exception->errorInfo ? $exception->errorInfo[1] : $exception->getCode();

switch (true) {
case 'pgsql' === $driver && '42P01' === $code:
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Component/Lock/Store/PdoStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ private function getCurrentTimestampStatement(): string
private function isTableMissing(\PDOException $exception): bool
{
$driver = $this->getDriver();
$code = $exception->getCode();
$code = $exception->errorInfo ? $exception->errorInfo[1] : $exception->getCode();

switch (true) {
case 'pgsql' === $driver && '42P01' === $code:
Expand Down

0 comments on commit 7318816

Please sign in to comment.