]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Fixed bug introduced in 0.9.5 by new pg8000 isolation level feature
authorMike Bayer <mike_mp@zzzcomputing.com>
Mon, 21 Jul 2014 15:58:44 +0000 (11:58 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 21 Jul 2014 15:58:44 +0000 (11:58 -0400)
where engine-level isolation level parameter would raise an error
on connect. fixes #3134

doc/build/changelog/changelog_09.rst
lib/sqlalchemy/dialects/postgresql/pg8000.py
test/requirements.py

index cfb5cb691c4ddeabb69f8dab4f59d391ccfc7c4a..326779d4af1c1035872fec33914c24b16685a89b 100644 (file)
     :version: 0.9.7
     :released:
 
+    .. change::
+        :tags: bug, postgresql, pg8000
+        :tickets: 3134
+        :versions: 1.0.0
+
+        Fixed bug introduced in 0.9.5 by new pg8000 isolation level feature
+        where engine-level isolation level parameter would raise an error
+        on connect.
+
     .. change::
         :tags: bug, oracle, tests
         :tickets: 3128
index 512f3e1b0905d5ce795fa22f8550b4ef399bfbac..589567d9e9d76c9c482f99858962d0edf413dbd9 100644 (file)
@@ -150,10 +150,14 @@ class PGDialect_pg8000(PGDialect):
     def set_isolation_level(self, connection, level):
         level = level.replace('_', ' ')
 
+        # adjust for ConnectionFairy possibly being present
+        if hasattr(connection, 'connection'):
+            connection = connection.connection
+
         if level == 'AUTOCOMMIT':
-            connection.connection.autocommit = True
+            connection.autocommit = True
         elif level in self._isolation_lookup:
-            connection.connection.autocommit = False
+            connection.autocommit = False
             cursor = connection.cursor()
             cursor.execute(
                 "SET SESSION CHARACTERISTICS AS TRANSACTION "
index 09f9735439518565913049d9e984206337931c93..f4fd6b601af893b39d113eaaf22e39d2161e50fc 100644 (file)
@@ -361,6 +361,7 @@ class DefaultRequirements(SuiteRequirements):
                        'need separate XA implementation'),
             exclude('mysql', '<', (5, 0, 3),
                         'two-phase xact not supported by database'),
+            no_support("postgresql+pg8000", "not supported and/or hangs")
             ])
 
     @property