Skip to content
Permalink
Browse files

bug #30050 [Cache] fix pruning pdo cache for vendors that throw on ex…

…ecute (bendavies)

This PR was merged into the 4.2 branch.

Discussion
----------

[Cache] fix pruning pdo cache for vendors that throw on execute

| Q             | A
| ------------- | ---
| Branch?       | 4.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no >
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets |
| License       | MIT
| Doc PR        |

This additionally fixes pruning of the PdoAdapter when the table does not exist.
Similar to #29900 #30005 and f419851

Commits
-------

14b9fa5 fix pruning pdo cache for vendors that throw on execute
  • Loading branch information...
nicolas-grekas committed Feb 1, 2019
2 parents 4f6541e + 14b9fa5 commit 4e4ebdece2c6e51dcae98e99b7b858a5235ebd33
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/Symfony/Component/Cache/Traits/PdoTrait.php
@@ -165,8 +165,11 @@ public function prune()
if ('' !== $this->namespace) {
$delete->bindValue(':namespace', sprintf('%s%%', $this->namespace), \PDO::PARAM_STR);
}
return $delete->execute();
try {
return $delete->execute();
} catch (TableNotFoundException $e) {
return true;
}
}
/**

0 comments on commit 4e4ebde

Please sign in to comment.
You can’t perform that action at this time.