From: Ants Aasma Date: Wed, 27 Jun 2007 09:54:33 +0000 (+0000) Subject: merge from trunk fix for undetected disconnects for mysql (ticket #625), r2793 X-Git-Tag: rel_0_4_6~172 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1a2fe74002bd3daeff10fc1d538837f2db650e9;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git merge from trunk fix for undetected disconnects for mysql (ticket #625), r2793 --- diff --git a/CHANGES b/CHANGES index b23c18d39f..1e9386551d 100644 --- a/CHANGES +++ b/CHANGES @@ -117,6 +117,7 @@ up ORM decision making [ticket:593] - added Interval type to types.py [ticket:595] - mysql + - fixed catching of some errors that imply a dropped connection [ticket:625] - fixed escaping of the modulo operator [ticket:624] - added 'fields' to reserved words [ticket:590] - oracle diff --git a/lib/sqlalchemy/databases/mysql.py b/lib/sqlalchemy/databases/mysql.py index cc304842ac..dfdebc5df4 100644 --- a/lib/sqlalchemy/databases/mysql.py +++ b/lib/sqlalchemy/databases/mysql.py @@ -1039,7 +1039,7 @@ class MySQLDialect(ansisql.ANSIDialect): pass def is_disconnect(self, e): - return isinstance(e, self.dbapi.OperationalError) and e.args[0] in (2006, 2014) + return isinstance(e, self.dbapi.OperationalError) and e.args[0] in (2006, 2013, 2014, 2045, 2055) def get_default_schema_name(self): if not hasattr(self, '_default_schema_name'):