Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

TableNotFound exception not handled in MySQL handling in Connection::get with autoSetup enabled #54120

Copy link
Copy link
Closed
@acbramley

Description

@acbramley
Issue body actions

Symfony version(s) affected

7.0

Description

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.

How to reproduce

Call Connection::get on a MySQL based DB when autosetup is enabled and the database table doesn't yet exist

Possible Solution

Catch a TableNotFoundException inside the if statement at the top of ::get

catch (TableNotFoundException) {
 if ($this->autoSetup) {
   $this->setup();
 }
}

Additional Context

This bug was found when implementing a Symfony Messenger based app on a Drupal site using https://www.drupal.org/project/sm - when attempting to consume messages before a message had been created (and therefore the table didn't exist) an exception was thrown.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.