]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
Don't check isolation level prior to SQL Server 2005
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 26 Jan 2017 21:54:02 +0000 (16:54 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 26 Jan 2017 21:54:02 +0000 (16:54 -0500)
Added a version check to the "get_isolation_level" feature, which is
invoked upon first connect, so that it skips for SQL Server version
2000, as the necessary system view is not available prior to SQL Server
2005.

Change-Id: If4f860513f0aae6625803f449714aedfc5075f57
Fixes: #3898
doc/build/changelog/changelog_11.rst
lib/sqlalchemy/dialects/mssql/base.py

index a969d616fd3431235a9c1b0bc49a76a01ca03448..33eca2eca6f643581f429a741dd1d556a27871e6 100644 (file)
 .. changelog::
     :version: 1.1.6
 
+    .. change:: 3898
+        :tags: bug, mssql
+        :tickets: 3898
+
+        Added a version check to the "get_isolation_level" feature, which is
+        invoked upon first connect, so that it skips for SQL Server version
+        2000, as the necessary system view is not available prior to SQL Server
+        2005.
+
     .. change:: 3893
         :tags: bug, orm
         :tickets: 3893
index 3e16e6e35c6b73ccf244fc69503f79ca466212ef..6975754c6379a1315d3963ee49f50dbf7b3d38d8 100644 (file)
@@ -1685,6 +1685,10 @@ class MSDialect(default.DefaultDialect):
         cursor.close()
 
     def get_isolation_level(self, connection):
+        if self.server_version_info < MS_2005_VERSION:
+            raise NotImplementedError(
+                "Can't fetch isolation level prior to SQL Server 2005")
+
         cursor = connection.cursor()
         cursor.execute("""
           SELECT CASE transaction_isolation_level