From 6b1d56a62c84ad16d77330a2949faf0a1da521f7 Mon Sep 17 00:00:00 2001 From: Heiko Date: Fri, 29 Mar 2019 11:10:36 +0100 Subject: [PATCH] fixed smg collections within the transaction, added gharial decoding (#8621) --- CHANGELOG | 7 +++++++ arangod/Graph/GraphOperations.cpp | 9 +++++++++ arangod/RestHandler/RestGraphHandler.cpp | 5 ++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 684f1a0799..427001c2fe 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,10 @@ +v3.4.6 (2019-XX-XX) +------------------- + +* fixed internal issue #3815: fixed the removal of connected edges when + removing a vertex graph node in a smart graph environment. + + v3.4.5 (2019-03-27) ------------------- diff --git a/arangod/Graph/GraphOperations.cpp b/arangod/Graph/GraphOperations.cpp index 3264e7c12b..067bd1924f 100644 --- a/arangod/Graph/GraphOperations.cpp +++ b/arangod/Graph/GraphOperations.cpp @@ -39,6 +39,7 @@ #include "RestServer/QueryRegistryFeature.h" #include "Transaction/Methods.h" #include "Transaction/SmartContext.h" +#include "Utils/CollectionNameResolver.h" #include "Utils/ExecContext.h" #include "Utils/OperationOptions.h" #include "Utils/SingleCollectionTransaction.h" @@ -776,8 +777,15 @@ OperationResult GraphOperations::removeEdgeOrVertex(const std::string& collectio trxCollections.emplace_back(collectionName); + CollectionNameResolver resolver {_vocbase}; for (auto const& it : edgeCollections) { trxCollections.emplace_back(it); + auto col = resolver.getCollection(it); + if (col && col->isSmart() && col->type() == TRI_COL_TYPE_EDGE) { + for (auto const& rn : col->realNames()) { + trxCollections.emplace_back(rn); + } + } } for (auto const& it : possibleEdgeCollections) { trxCollections.emplace_back(it); // add to trx collections @@ -787,6 +795,7 @@ OperationResult GraphOperations::removeEdgeOrVertex(const std::string& collectio transaction::Options trxOptions; trxOptions.waitForSync = waitForSync; auto context = ctx(); + UserTransaction trx{context, {}, trxCollections, {}, trxOptions}; res = trx.begin(); diff --git a/arangod/RestHandler/RestGraphHandler.cpp b/arangod/RestHandler/RestGraphHandler.cpp index b4470e5e99..3b942b992a 100644 --- a/arangod/RestHandler/RestGraphHandler.cpp +++ b/arangod/RestHandler/RestGraphHandler.cpp @@ -27,6 +27,7 @@ #include #include "Aql/Query.h" +#include "Basics/StringUtils.h" #include "Basics/VelocyPackHelper.h" #include "Graph/Graph.h" #include "Graph/GraphManager.h" @@ -57,7 +58,9 @@ Result RestGraphHandler::executeGharial() { auto suffix = request()->suffixes().begin(); auto end = request()->suffixes().end(); - auto getNextSuffix = [&suffix]() { return *suffix++; }; + auto getNextSuffix = [&suffix]() { + return basics::StringUtils::urlDecodePath(*suffix++); + }; auto noMoreSuffixes = [&suffix, &end]() { return suffix == end; };