From c25fd3fb4873ce6691eeeeae8839eb61b1dcad37 Mon Sep 17 00:00:00 2001 From: "Gregory P. Smith" Date: Fri, 17 Jan 2003 07:52:59 +0000 Subject: 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. --- Lib/bsddb/test/test_basics.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'Lib/bsddb/test/test_basics.py') diff --git a/Lib/bsddb/test/test_basics.py b/Lib/bsddb/test/test_basics.py index 37f4d11bc4..7524b35eaf 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): -- cgit v1.2.1