Commit cb13a9f4 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 613dbf6a
...@@ -97,14 +97,19 @@ def main(): ...@@ -97,14 +97,19 @@ def main():
{"x-generator": "zodb/py2 (undo %s)" % ul["id"]}) {"x-generator": "zodb/py2 (undo %s)" % ul["id"]})
# delete an object # delete an object
#obj = random.choice(root.values()) name = random.choice(root.keys())
#txn = precommit(u"root%i\nYour\nRoyal\nMagesty " % i, obj = root[name]
# u"delete %i\nalpha beta gamma\n\nqqq ..." % i, root[name] = Object("%s%i*" % (name, i))
# {"x-generator": "zodb/py2 (delete %s)" % hex64(obj._p_oid)}) # NOTE user/ext are kept empty on purpose - to also test this case
#stor.tpc_begin(txn) commit(u"", u"predelete %s" % unpack64(obj._p_oid), {})
#stor.deleteObject(obj._p_oid, obj._p_serial, txn)
#stor.tpc_vote(txn) txn = precommit(u"root%i\nYour\nRoyal\nMagesty " % i,
#stor.tpc_finish(txn) u"delete %i\nalpha beta gamma\n\nqqq ..." % i,
{"x-generator": "zodb/py2 (delete %s)" % unpack64(obj._p_oid)})
stor.tpc_begin(txn)
stor.deleteObject(obj._p_oid, obj._p_serial, txn)
stor.tpc_vote(txn)
stor.tpc_finish(txn)
# close db & rest not to get conflict errors after we touched stor # close db & rest not to get conflict errors after we touched stor
# directly a bit. everything will be reopened on next iteration. # directly a bit. everything will be reopened on next iteration.
...@@ -188,8 +193,12 @@ def main(): ...@@ -188,8 +193,12 @@ def main():
plen = dh.plen plen = dh.plen
if plen == 0: if plen == 0:
rawdata = p64(dh.back) # back-pointer or 0 (= delete) rawdata = p64(dh.back) # back-pointer or 0 (= delete)
data = "[]byte(%s)" % escapeqq(drec.data) if drec.data is None:
datatid = hex64(drec.data_txn) # XXX vs .data = None ? data = "/* deleted */ nil"
datatid = "/* deleted */ 0"
else:
data = "[]byte(%s)" % escapeqq(drec.data)
datatid = hex64(drec.data_txn)
else: else:
rawdata = drec.data rawdata = drec.data
data = "/* same as ^^^ */ nil" data = "/* same as ^^^ */ nil"
......
This diff is collapsed.
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