From 7ea41301037e4d8f9ffaad3388dc81c4292ddebb Mon Sep 17 00:00:00 2001 From: Michael Hackstein Date: Thu, 22 Oct 2015 12:13:47 +0200 Subject: [PATCH] Fixed array indexing if the attribute is not set --- arangod/Indexes/HashIndex.cpp | 2 +- js/server/tests/shell-array-index-noncluster.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arangod/Indexes/HashIndex.cpp b/arangod/Indexes/HashIndex.cpp index f6a318e932..48c10db7a9 100644 --- a/arangod/Indexes/HashIndex.cpp +++ b/arangod/Indexes/HashIndex.cpp @@ -666,7 +666,7 @@ int HashIndex::insertMulti (TRI_doc_mptr_t const* doc, return TRI_ERROR_NO_ERROR; } // This is TRI_RESULT_ELEMENT_EXISTS, but this should not happen: - return TRI_ERROR_INTERNAL; + return TRI_ERROR_NO_ERROR; } return TRI_ERROR_NO_ERROR; diff --git a/js/server/tests/shell-array-index-noncluster.js b/js/server/tests/shell-array-index-noncluster.js index 552d3e1ab0..cc665f21be 100644 --- a/js/server/tests/shell-array-index-noncluster.js +++ b/js/server/tests/shell-array-index-noncluster.js @@ -298,7 +298,6 @@ function arrayHashIndexSuite () { assertEqual(res.length, 0); }, - /* testInsertAndReadNestedElements: function () { var idx = collection.ensureHashIndex("a[*].b").id; var id1 = collection.save({a: [{b: 1}]})._id; @@ -306,6 +305,7 @@ function arrayHashIndexSuite () { collection.save({a: [1,2,3]}); collection.save({b: [1,2,3]}); + /* var res = collection.BY_EXAMPLE_HASH(idx, {a: {b: 1} }, 0, null).documents; assertEqual(res.length, 2); assertEqual(res[0]._id, id1); @@ -314,8 +314,8 @@ function arrayHashIndexSuite () { res = collection.BY_EXAMPLE_HASH(idx, {a: {b: 2} }, 0, null).documents; assertEqual(res.length, 1); assertEqual(res[0]._id, id2); + */ }, - */ }; }