[Zope-Checkins] CVS: StandaloneZODB/ZODB - FileStorage.py:1.77.4.5

Jeremy Hylton jeremy@zope.com
Thu, 24 Jan 2002 13:13:27 -0500


Update of /cvs-repository/StandaloneZODB/ZODB
In directory cvs.zope.org:/tmp/cvs-serv23924

Modified Files:
      Tag: Recovery
	FileStorage.py 
Log Message:
Apply iterator fix from branch.


=== StandaloneZODB/ZODB/FileStorage.py 1.77.4.4 => 1.77.4.5 ===
 
             self._pos=pos+dlen
-            if plen: p=read(plen)
+            if plen:
+                p = read(plen)
             else:
-                p=read(8)
-                p=_loadBack(file, oid, p)[0]
+                p = read(8)
+                if p == z64:
+                    # If the backpointer is 0 (encoded as z64), then
+                    # this transaction undoes the object creation.  It
+                    # either aborts the version that created the
+                    # object or undid the transaction that created it.
+                    # Return None instead of a pickle to indicate
+                    # this.
+                    p = None
+                else:
+                    p = _loadBack(file, oid, p)[0]
                 
             r=Record(oid, serial, version, p)