[Checkins] SVN: Zope3/branches/3.3/src/zope/index/field/ Happened at least once that the value dropped out of the forward index,

Adam Groszer adamg at fw.hu
Mon Nov 20 04:43:59 EST 2006


Log message for revision 71194:
  Happened at least once that the value dropped out of the forward index,
  but the index still contains the object, the unindex broke

Changed:
  U   Zope3/branches/3.3/src/zope/index/field/README.txt
  U   Zope3/branches/3.3/src/zope/index/field/index.py

-=-
Modified: Zope3/branches/3.3/src/zope/index/field/README.txt
===================================================================
--- Zope3/branches/3.3/src/zope/index/field/README.txt	2006-11-20 09:42:36 UTC (rev 71193)
+++ Zope3/branches/3.3/src/zope/index/field/README.txt	2006-11-20 09:43:58 UTC (rev 71194)
@@ -107,3 +107,65 @@
 
     >>> index.apply((30, 70))
     IFSet([])
+
+Bugfix testing:
+---------------
+Happened at least once that the value dropped out of the forward index,
+but the index still contains the object, the unindex broke
+
+    >>> index.index_doc(0, 6)
+    >>> index.index_doc(1, 26)
+    >>> index.index_doc(2, 94)
+    >>> index.index_doc(3, 68)
+    >>> index.index_doc(4, 30)
+    >>> index.index_doc(5, 68)
+    >>> index.index_doc(6, 82)
+    >>> index.index_doc(7, 30)
+    >>> index.index_doc(8, 43)
+    >>> index.index_doc(9, 15)
+    
+    >>> index.apply((None, None))
+    IFSet([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
+
+Here is the damage:
+
+    >>> del index._fwd_index[68]
+    
+Unindex should succeed:
+    
+    >>> index.unindex_doc(5)
+    >>> index.unindex_doc(3)
+    
+    >>> index.apply((None, None))
+    IFSet([0, 1, 2, 4, 6, 7, 8, 9])
+
+Bugfix testing:
+---------------
+Happened at least once that the value dropped out of the forward index,
+but the index still contains the object, the unindex broke
+
+    >>> index.index_doc(0, 6)
+    >>> index.index_doc(1, 26)
+    >>> index.index_doc(2, 94)
+    >>> index.index_doc(3, 68)
+    >>> index.index_doc(4, 30)
+    >>> index.index_doc(5, 68)
+    >>> index.index_doc(6, 82)
+    >>> index.index_doc(7, 30)
+    >>> index.index_doc(8, 43)
+    >>> index.index_doc(9, 15)
+    
+    >>> index.apply((None, None))
+    IFSet([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
+
+Here is the damage:
+
+    >>> del index._fwd_index[68]
+    
+Unindex should succeed:
+    
+    >>> index.unindex_doc(5)
+    >>> index.unindex_doc(3)
+    
+    >>> index.apply((None, None))
+    IFSet([0, 1, 2, 4, 6, 7, 8, 9])

Modified: Zope3/branches/3.3/src/zope/index/field/index.py
===================================================================
--- Zope3/branches/3.3/src/zope/index/field/index.py	2006-11-20 09:42:36 UTC (rev 71193)
+++ Zope3/branches/3.3/src/zope/index/field/index.py	2006-11-20 09:43:58 UTC (rev 71194)
@@ -88,7 +88,8 @@
         except KeyError:
             # This is fishy, but we don't want to raise an error.
             # We should probably log something.
-            pass
+            # but keep it from throwing a dirty exception
+            set = 1
 
         if not set:
             del self._fwd_index[value]



More information about the Checkins mailing list