From a17ec21767f27ef100622e2794222dec9bb3bdba Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 14 Nov 2019 10:21:16 +0100 Subject: [PATCH] fix invalid assertion (#10428) --- arangod/Transaction/Methods.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arangod/Transaction/Methods.cpp b/arangod/Transaction/Methods.cpp index 8db156aa23..5282955a1f 100644 --- a/arangod/Transaction/Methods.cpp +++ b/arangod/Transaction/Methods.cpp @@ -1826,8 +1826,8 @@ OperationResult transaction::Methods::insertLocal(std::string const& collectionN if (res.fail()) { // Error reporting in the babies case is done outside of here, - if (res.is(TRI_ERROR_ARANGO_CONFLICT) && !isBabies) { - TRI_ASSERT(prevDocResult.revisionId() != 0); + if (res.is(TRI_ERROR_ARANGO_CONFLICT) && !isBabies && prevDocResult.revisionId() != 0) { + TRI_ASSERT(didReplace); arangodb::velocypack::StringRef key = value.get(StaticStrings::KeyString).stringRef(); buildDocumentIdentity(collection, resultBuilder, cid, key, prevDocResult.revisionId(), @@ -1837,7 +1837,7 @@ OperationResult transaction::Methods::insertLocal(std::string const& collectionN } if (!options.silent) { - const bool showReplaced = (options.returnOld && didReplace); + bool const showReplaced = (options.returnOld && didReplace); TRI_ASSERT(!options.returnNew || !docResult.empty()); TRI_ASSERT(!showReplaced || !prevDocResult.empty());