[Zope3-checkins] SVN: Zope3/branches/3.2/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:42:36 EST 2006


Log message for revision 71193:
  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.2/src/zope/index/field/README.txt
  U   Zope3/branches/3.2/src/zope/index/field/index.py

-=-
Modified: Zope3/branches/3.2/src/zope/index/field/README.txt
===================================================================
--- Zope3/branches/3.2/src/zope/index/field/README.txt	2006-11-20 09:40:50 UTC (rev 71192)
+++ Zope3/branches/3.2/src/zope/index/field/README.txt	2006-11-20 09:42:36 UTC (rev 71193)
@@ -107,3 +107,34 @@
 
     >>> 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])

Modified: Zope3/branches/3.2/src/zope/index/field/index.py
===================================================================
--- Zope3/branches/3.2/src/zope/index/field/index.py	2006-11-20 09:40:50 UTC (rev 71192)
+++ Zope3/branches/3.2/src/zope/index/field/index.py	2006-11-20 09:42:36 UTC (rev 71193)
@@ -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 Zope3-Checkins mailing list