diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2003-01-17 07:52:59 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2003-01-17 07:52:59 (GMT) |
commit | c25fd3fb4873ce6691eeeeae8839eb61b1dcad37 (patch) | |
tree | 348e91dbd079d359aa4ca37b0f48511aed251b15 /Lib | |
parent | 5ec186b1cbf06cf66262882fb5b6f54a893e48a5 (diff) | |
download | cpython-c25fd3fb4873ce6691eeeeae8839eb61b1dcad37.zip cpython-c25fd3fb4873ce6691eeeeae8839eb61b1dcad37.tar.gz cpython-c25fd3fb4873ce6691eeeeae8839eb61b1dcad37.tar.bz2 |
bugfix: disallow use of DB_TXN after commit() or abort(), prevents a
coredump or segmentation violation.
Sourceforge patch ID 664896:
http://sourceforge.net/tracker/index.php?func=detail&aid=664896&group_id=13900&atid=313900
The bug was reported on the pybsddb-users mailing list.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/bsddb/test/test_basics.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Lib/bsddb/test/test_basics.py b/Lib/bsddb/test/test_basics.py index 37f4d11..7524b35 100644 --- a/Lib/bsddb/test/test_basics.py +++ b/Lib/bsddb/test/test_basics.py @@ -604,6 +604,26 @@ class BasicTransactionTestCase(BasicTestCase): assert num == 0, "truncate on empty DB returned nonzero (%s)" % `num` txn.commit() + #---------------------------------------- + + def test08_TxnLateUse(self): + txn = self.env.txn_begin() + txn.abort() + try: + txn.abort() + except db.DBError, e: + pass + else: + raise RuntimeError, "DBTxn.abort() called after DB_TXN no longer valid w/o an exception" + + txn = self.env.txn_begin() + txn.commit() + try: + txn.commit() + except db.DBError, e: + pass + else: + raise RuntimeError, "DBTxn.commit() called after DB_TXN no longer valid w/o an exception" class BTreeTransactionTestCase(BasicTransactionTestCase): |