diff options
| author | mike bayer <mike_mp@zzzcomputing.com> | 2021-12-16 16:08:33 +0000 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@ci3.zzzcomputing.com> | 2021-12-16 16:08:33 +0000 |
| commit | 3543fcc9c9601e81560d055ceadaea05c75815c0 (patch) | |
| tree | e0287f4fced80f1ec41f723c5c7fe6d81f07127c /lib/sqlalchemy | |
| parent | 11c879e7ebe5947b9733b2c16adc0c106d3ce085 (diff) | |
| parent | 3a33fa8b0acd9220ef4428ac6a56ebd8d40c3762 (diff) | |
| download | sqlalchemy-3543fcc9c9601e81560d055ceadaea05c75815c0.tar.gz | |
Merge "include InterfaceError for mariadb disconnect check" into main
Diffstat (limited to 'lib/sqlalchemy')
| -rw-r--r-- | lib/sqlalchemy/dialects/mysql/base.py | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py index fef1ec81a..fe0624d08 100644 --- a/lib/sqlalchemy/dialects/mysql/base.py +++ b/lib/sqlalchemy/dialects/mysql/base.py @@ -2540,16 +2540,21 @@ class MySQLDialect(default.DefaultDialect): def is_disconnect(self, e, connection, cursor): if isinstance( - e, (self.dbapi.OperationalError, self.dbapi.ProgrammingError) + e, + ( + self.dbapi.OperationalError, + self.dbapi.ProgrammingError, + self.dbapi.InterfaceError, + ), + ) and self._extract_error_code(e) in ( + 1927, + 2006, + 2013, + 2014, + 2045, + 2055, ): - return self._extract_error_code(e) in ( - 1927, - 2006, - 2013, - 2014, - 2045, - 2055, - ) + return True elif isinstance( e, (self.dbapi.InterfaceError, self.dbapi.InternalError) ): |
