]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Add 10054 to ODBC / SQL Server disconnect codes
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 16 Jan 2018 18:02:17 +0000 (13:02 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 16 Jan 2018 18:02:17 +0000 (13:02 -0500)
Change-Id: I6e2518232608f47515b96984b4b7a41b8385975a
Fixes: #4164
doc/build/changelog/unreleased_12/4164.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/mssql/pyodbc.py

diff --git a/doc/build/changelog/unreleased_12/4164.rst b/doc/build/changelog/unreleased_12/4164.rst
new file mode 100644 (file)
index 0000000..7ea69df
--- /dev/null
@@ -0,0 +1,7 @@
+.. change::
+    :tags: bug, mssql
+    :tickets: 4164
+
+    Added ODBC error code 10054 to the list of error
+    codes that count as a disconnect for ODBC / MSSQL server.
+
index c66c45ec68abc3490d938e1af0b2c5e3f9d53684..b8f7bef36b1eedcdea75d50ffbc80a96f26face0 100644 (file)
@@ -299,7 +299,8 @@ class MSDialect_pyodbc(PyODBCConnector, MSDialect):
         if isinstance(e, self.dbapi.Error):
             for code in (
                     '08S01', '01002', '08003', '08007',
-                    '08S02', '08001', 'HYT00', 'HY010'):
+                    '08S02', '08001', 'HYT00', 'HY010',
+                    '10054'):
                 if code in str(e):
                     return True
         return super(MSDialect_pyodbc, self).is_disconnect(