diff options
| -rw-r--r-- | doc/build/changelog/unreleased_10/4065.rst | 9 | ||||
| -rw-r--r-- | lib/sqlalchemy/dialects/mysql/base.py | 3 |
2 files changed, 11 insertions, 1 deletions
diff --git a/doc/build/changelog/unreleased_10/4065.rst b/doc/build/changelog/unreleased_10/4065.rst new file mode 100644 index 000000000..375ce8cf1 --- /dev/null +++ b/doc/build/changelog/unreleased_10/4065.rst @@ -0,0 +1,9 @@ +.. change:: + :tags: bug, mysql + :tickets: 4065 + :versions: 1.2.0b3, 1.1.14 + + mysqlclient as of 1.3.11 changed the exception + class for a particular disconnect situation from + InterfaceError to InternalError; the disconnection + detection logic now accommodates this. diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py index 5b01b2c1f..976ff367b 100644 --- a/lib/sqlalchemy/dialects/mysql/base.py +++ b/lib/sqlalchemy/dialects/mysql/base.py @@ -1785,7 +1785,8 @@ class MySQLDialect(default.DefaultDialect): self.dbapi.ProgrammingError)): return self._extract_error_code(e) in \ (2006, 2013, 2014, 2045, 2055) - elif isinstance(e, self.dbapi.InterfaceError): + elif isinstance( + e, (self.dbapi.InterfaceError, self.dbapi.InternalError)): # if underlying connection is closed, # this is the error you get return "(0, '')" in str(e) |
