bug #30050 [Cache] fix pruning pdo cache for vendors that throw on execute (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 https://github.com/symfony/symfony/pull/29900 https://github.com/symfony/symfony/pull/30005 and f419851eb1

Commits
-------

14b9fa5234 fix pruning pdo cache for vendors that throw on execute
This commit is contained in:
Nicolas Grekas 2019-02-01 11:22:08 +01:00
commit 4e4ebdece2
1 changed files with 5 additions and 2 deletions

View File

@ -165,8 +165,11 @@ trait PdoTrait
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;
}
}
/**