diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-06-27 15:52:40 -0400 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-06-27 15:52:40 -0400 |
| commit | 3ea154fbf5dbda642141a5867afac6b0fc97e3cb (patch) | |
| tree | ee53815f0a6cd592f524641c15a1cc3bf2d232d5 /lib/sqlalchemy/dialects/mysql/base.py | |
| parent | f2cf62090c4f9812bf4a57a9f68172b1b2eafd6c (diff) | |
| download | sqlalchemy-3ea154fbf5dbda642141a5867afac6b0fc97e3cb.tar.gz | |
- MySQL error 2014 "commands out of sync" appears to be raised as a
ProgrammingError, not OperationalError, in modern MySQL-Python versions;
all MySQL error codes that are tested for "is disconnect" are now
checked within OperationalError and ProgrammingError regardless.
fixes #3101
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/base.py')
| -rw-r--r-- | lib/sqlalchemy/dialects/mysql/base.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/base.py b/lib/sqlalchemy/dialects/mysql/base.py index 6d8b6a07c..77fb34fd8 100644 --- a/lib/sqlalchemy/dialects/mysql/base.py +++ b/lib/sqlalchemy/dialects/mysql/base.py @@ -2225,7 +2225,7 @@ class MySQLDialect(default.DefaultDialect): return [row['data'][0:row['gtrid_length']] for row in resultset] def is_disconnect(self, e, connection, cursor): - if isinstance(e, self.dbapi.OperationalError): + if isinstance(e, (self.dbapi.OperationalError, self.dbapi.ProgrammingError)): return self._extract_error_code(e) in \ (2006, 2013, 2014, 2045, 2055) elif isinstance(e, self.dbapi.InterfaceError): |
