From a108d9a38ff497e12176922a09b3ba25b6114c47 Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Sat, 19 May 2012 20:33:28 +0200 Subject: [PATCH] fixed picking of wrong indexes if multiple indexes are available --- Ahuacatl/ahuacatl-index.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Ahuacatl/ahuacatl-index.c b/Ahuacatl/ahuacatl-index.c index 4cd2f3e468..1286e0f1d8 100644 --- a/Ahuacatl/ahuacatl-index.c +++ b/Ahuacatl/ahuacatl-index.c @@ -270,6 +270,13 @@ TRI_aql_index_t* TRI_DetermineIndexAql (TRI_aql_context_t* const context, TRI_PushBackVectorPointer(&matches, candidate); } } + + // finished iterating over all candidates + + if (matches._length != j + 1) { + // we already have picked less candidate fields than we should + break; + } } if (matches._length < 1) {