8000 bug #54121 [Messenger] Catch TableNotFoundException in MySQL delete (… · symfony/symfony@56418da · GitHub
[go: up one dir, main page]

Skip to content

Commit 56418da

Browse files
committed
bug #54121 [Messenger] Catch TableNotFoundException in MySQL delete (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
2 parents 2ce3e04 + 410bcce commit 56418da

File tree

1 file changed

+4
-0
lines changed
  • src/Symfony/Component/Messenger/Bridge/Doctrine/Transport

1 file changed

+4
-0
lines changed

src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/Connection.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@ public function get(): ?array
161161
$this->driverConnection->delete($this->configuration['table_name'], ['delivered_at' => '9999-12-31 23:59:59']);
162162
} catch (DriverException $e) {
163163
// Ignore the exception
164+
} catch (TableNotFoundException $e) {
165+
if ($this->autoSetup) {
166+
$this->setup();
167+
}
164168
}
165169
}
166170

0 commit comments

Comments
 (0)
0