From af623854fa9cbb5d96c9cf4bffd36436b33f40ae Mon Sep 17 00:00:00 2001 From: Michael Hackstein Date: Thu, 29 Sep 2016 14:01:18 +0200 Subject: [PATCH] Fixed Smart graph injection of collections. --- arangod/Aql/TraversalNode.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arangod/Aql/TraversalNode.cpp b/arangod/Aql/TraversalNode.cpp index 6bcbfe79a0..d3cbfdfc43 100644 --- a/arangod/Aql/TraversalNode.cpp +++ b/arangod/Aql/TraversalNode.cpp @@ -282,6 +282,23 @@ TraversalNode::TraversalNode(ExecutionPlan* plan, size_t id, } auto addEdgeColl = [&](std::string const& n) -> void { + if (_isSmart) { + if (n.compare(0, 6, "_from_") == 0) { + if (baseDirection == TRI_EDGE_ANY || baseDirection == TRI_EDGE_OUT) { + _directions.emplace_back(TRI_EDGE_OUT); + _edgeColls.emplace_back(std::make_unique( + n, _vocbase, TRI_TRANSACTION_READ)); + } + return; + } else if (n.compare(0, 4, "_to_") == 0) { + if (baseDirection == TRI_EDGE_ANY || baseDirection == TRI_EDGE_IN) { + _directions.emplace_back(TRI_EDGE_IN); + _edgeColls.emplace_back(std::make_unique( + n, _vocbase, TRI_TRANSACTION_READ)); + } + return; + } + } if (baseDirection == TRI_EDGE_ANY) { _directions.emplace_back(TRI_EDGE_OUT); _edgeColls.emplace_back(std::make_unique(