Title: [commits] (vajda) [11259] - fixed several index merging bugs found while reproducing bug 6266
Revision
11259
Author
vajda
Date
2006-07-26 07:37:35 -0700 (Wed, 26 Jul 2006)

Log Message

- fixed several index merging bugs found while reproducing bug 6266

Modified Paths

Diff

Modified: trunk/chandler/repository/item/Indexed.py (11258 => 11259)

--- trunk/chandler/repository/item/Indexed.py	2006-07-25 23:48:33 UTC (rev 11258)
+++ trunk/chandler/repository/item/Indexed.py	2006-07-26 14:37:35 UTC (rev 11259)
@@ -204,8 +204,7 @@
             _indexChanges = {}
 
             for indexName, index in indexes.iteritems():
-                if index._needsReindexing():
-                    _indexChanges[indexName] = dict(index._iterChanges())
+                _indexChanges[indexName] = dict(index._iterChanges())
 
             if _indexChanges:
                 indexChanges[name] = _indexChanges
@@ -237,6 +236,8 @@
             for key in insertions:
                 index.insertKey(key)
 
+        self._setDirty(True)
+
     def _createIndex(self, indexType, **kwds):
 
         if indexType == 'numeric':

Modified: trunk/chandler/repository/item/Indexes.py (11258 => 11259)

--- trunk/chandler/repository/item/Indexes.py	2006-07-25 23:48:33 UTC (rev 11258)
+++ trunk/chandler/repository/item/Indexes.py	2006-07-26 14:37:35 UTC (rev 11259)
@@ -121,22 +121,19 @@
     def _xmlValues(self, generator, version):
         raise NotImplementedError, "%s._xmlValues" %(type(self))
 
-    def _needsReindexing(self):
-        return False
-
     def _checkIndex(self, _index, logger, name, value, item, attribute, count):
 
         result = True
 
         if count != len(self):
-            logger.error("Lengths of index '%s' (%d) installed on value '%s' (%d) of type %s in attribute %s on %s don't match", name, len(self), value, count, type(value), attribute, item._repr_())
+            logger.error("Lengths of index '%s' (%d) installed on value '%s' (%d) of type %s in attribute '%s' on %s don't match", name, len(self), value, count, type(value), attribute, item._repr_())
             result = False
 
         else:
             size, result = _index._checkIterateIndex(logger, name, value,
                                                      item, attribute)
             if size != 0:
-                logger.error("Iteration of index '%s' (%d) installed on value '%s' of type %s in attribute %s on %s doesn't match length (%d)", name, count - size, value, type(value), attribute, item._repr_(), count)
+                logger.error("Iteration of index '%s' (%d) installed on value '%s' of type %s in attribute '%s' on %s doesn't match length (%d)", name, count - size, value, type(value), attribute, item._repr_(), count)
                 result = False
 
         return result
@@ -543,10 +540,6 @@
         
         self._subIndexes.remove((uuid, attr, name))
 
-    def _needsReindexing(self):
-
-        return True
-
     def _checkIndex(self, _index, logger, name, value, item, attribute, count):
 
         return self._index._checkIndex(self, logger, name, value,
@@ -575,7 +568,7 @@
                 else:
                     sorted = compare(prevKey, key) <= 0
                 if not sorted:
-                    logger.error("Sorted index '%s' installed on value '%s' of type %s in attribute %s on %s is not sorted properly: value for %s is %s than the value for %s", name, value, type(value), attribute, item._repr_(), repr(prevKey), word, repr(key))
+                    logger.error("Sorted index '%s' installed on value '%s' of type %s in attribute '%s' on %s is not sorted properly: value for %s is %s than the value for %s", name, value, type(value), attribute, item._repr_(), repr(prevKey), word, repr(key))
                     result = True #Kludge to green tinderboxes until bug #6387  is fixed
             prevKey = key
 




_______________________________________________
Commits mailing list
[email protected]
http://lists.osafoundation.org/mailman/listinfo/commits

Reply via email to