Skip to content

Commit

Permalink
bug #54121 [Messenger] Catch TableNotFoundException in MySQL delete (…
Browse files Browse the repository at this point in the history
…acbramley)

This PR was merged into the 5.4 branch.

Discussion
----------

[Messenger] Catch TableNotFoundException in MySQL delete

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

When using a MySQL based DB, if the database table doesn't exist when calling Connection::get - it will result in an exception even when auto setup is enabled.

I still need to look into how/where tests would go.

Commits
-------

410bcce Catch TableNotFoundException in MySQL delete
  • Loading branch information
fabpot committed Mar 17, 2024
2 parents 2ce3e04 + 410bcce commit 56418da
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ public function get(): ?array
$this->driverConnection->delete($this->configuration['table_name'], ['delivered_at' => '9999-12-31 23:59:59']);
} catch (DriverException $e) {
// Ignore the exception
} catch (TableNotFoundException $e) {
if ($this->autoSetup) {
$this->setup();
}
}
}

Expand Down

0 comments on commit 56418da

Please sign in to comment.