Commit 03bf302a authored by Julien Muchembled's avatar Julien Muchembled

btree: fix missing u64 oid conversion in deleteTransaction

Also clean up deleteObject.
parent fe5526cb
...@@ -411,14 +411,15 @@ class BTreeDatabaseManager(DatabaseManager): ...@@ -411,14 +411,15 @@ class BTreeDatabaseManager(DatabaseManager):
recycle_subtrees=recycle_subtrees) recycle_subtrees=recycle_subtrees)
def deleteTransaction(self, tid, oid_list=()): def deleteTransaction(self, tid, oid_list=()):
tid = util.u64(tid) u64 = util.u64
tid = u64(tid)
self._popTransactionFromTObj(tid, False) self._popTransactionFromTObj(tid, False)
try: try:
del self._ttrans[tid] del self._ttrans[tid]
except KeyError: except KeyError:
pass pass
for oid in oid_list: for oid in oid_list:
self._deleteObject(oid, serial=tid) self._deleteObject(u64(oid), tid)
try: try:
del self._trans[tid] del self._trans[tid]
except KeyError: except KeyError:
...@@ -432,10 +433,7 @@ class BTreeDatabaseManager(DatabaseManager): ...@@ -432,10 +433,7 @@ class BTreeDatabaseManager(DatabaseManager):
def deleteObject(self, oid, serial=None): def deleteObject(self, oid, serial=None):
u64 = util.u64 u64 = util.u64
oid = u64(oid) self._deleteObject(u64(oid), serial and u64(serial))
if serial is not None:
serial = u64(serial)
self._deleteObject(oid, serial=serial)
def _deleteObject(self, oid, serial=None): def _deleteObject(self, oid, serial=None):
obj = self._obj obj = self._obj
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment