Skip to content

Commit

Permalink
bug #54201 [Lock] Check the correct SQLSTATE error code for MySQL (ed…
Browse files Browse the repository at this point in the history
…omato)

This PR was merged into the 5.4 branch.

Discussion
----------

[Lock] Check the correct SQLSTATE error code for MySQL

* Closes bug: #54091

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | Fix #54091
| License       | MIT

Commits
-------

7318816 [Lock] Check the correct SQLSTATE error code for MySQL
  • Loading branch information
nicolas-grekas committed Mar 13, 2024
2 parents 6e8d627 + 7318816 commit 6fadff7
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
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
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 6fadff7

Please sign in to comment.