mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-15 05:26:37 +03:00
Fixed refcount in connection's readonly and deferrable getters
Close #790
This commit is contained in:
parent
74fd0ec063
commit
ed6f32999f
2
NEWS
2
NEWS
|
@ -8,6 +8,8 @@ What's new in psycopg 2.7.6
|
||||||
(:ticket:`#746`).
|
(:ticket:`#746`).
|
||||||
- Fixed building on modern FreeBSD versions with Python 3.7 (:ticket:`#755`).
|
- Fixed building on modern FreeBSD versions with Python 3.7 (:ticket:`#755`).
|
||||||
- Fixed hang trying to :sql:`COPY` via `~cursor.execute()` (:ticket:`#781`).
|
- Fixed hang trying to :sql:`COPY` via `~cursor.execute()` (:ticket:`#781`).
|
||||||
|
- Fixed segfault accessing the `connection.readonly` and
|
||||||
|
`connection.deferrable` repeatedly (:ticket:`#790`).
|
||||||
|
|
||||||
|
|
||||||
What's new in psycopg 2.7.5
|
What's new in psycopg 2.7.5
|
||||||
|
|
|
@ -757,6 +757,7 @@ psyco_conn_readonly_get(connectionObject *self)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Py_XINCREF(rv);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -803,6 +804,7 @@ psyco_conn_deferrable_get(connectionObject *self)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Py_XINCREF(rv);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -804,6 +804,14 @@ class IsolationLevelsTestCase(ConnectingTestCase):
|
||||||
self.assertRaises(ValueError, setattr, self.conn, 'isolation_level', 5)
|
self.assertRaises(ValueError, setattr, self.conn, 'isolation_level', 5)
|
||||||
self.assertRaises(ValueError, setattr, self.conn, 'isolation_level', 'bah')
|
self.assertRaises(ValueError, setattr, self.conn, 'isolation_level', 'bah')
|
||||||
|
|
||||||
|
def test_attribs_segfault(self):
|
||||||
|
# bug #790
|
||||||
|
for i in range(10000):
|
||||||
|
self.conn.autocommit
|
||||||
|
self.conn.readonly
|
||||||
|
self.conn.deferrable
|
||||||
|
self.conn.isolation_level
|
||||||
|
|
||||||
|
|
||||||
class ConnectionTwoPhaseTests(ConnectingTestCase):
|
class ConnectionTwoPhaseTests(ConnectingTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user