Commit 7b76e467 authored by Hanno Schlichting's avatar Hanno Schlichting

Fixed a problem with incomplete plan surfaced by the CMF tests

parent 065e091c
......@@ -514,7 +514,13 @@ class Catalog(Persistent, Acquisition.Implicit, ExtensionClass.Base):
if not plan:
plan = self._sorted_search_indexes(query)
indexes = self.indexes.keys()
for i in plan:
if i not in indexes:
# We can have bogus keys or the plan can contain index names
# that have been removed in the meantime
continue
index = self.getIndex(i)
_apply_index = getattr(index, "_apply_index", None)
if _apply_index is None:
......
......@@ -287,6 +287,10 @@ class CatalogPlan(object):
def stop(self):
self.end_time = time.time()
self.duration = self.end_time - self.start_time
# Make absolutely sure we never omit query keys from the plan
for key in self.query.keys():
if key not in self.benchmark.keys():
self.benchmark[key] = Benchmark(0, 0, 0, False)
PriorityMap.set_entry(self.cid, self.key, self.benchmark)
self.log()
......
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