mirror of https://gitee.com/bigwinds/arangodb
Implemented unique edges on path for AQL traversal in cluster case
This commit is contained in:
parent
6636dec958
commit
f589308bd0
|
@ -209,8 +209,15 @@ void ClusterTraverser::EdgeGetter::operator() (std::string const& startVertex,
|
||||||
std::string next = stack.top();
|
std::string next = stack.top();
|
||||||
stack.pop();
|
stack.pop();
|
||||||
last = &_continueConst;
|
last = &_continueConst;
|
||||||
result.push_back(next);
|
|
||||||
_traverser->_iteratorCache.emplace(stack);
|
_traverser->_iteratorCache.emplace(stack);
|
||||||
|
auto search = std::find(result.begin(), result.end(), next);
|
||||||
|
if (search != result.end()) {
|
||||||
|
result.push_back(next);
|
||||||
|
// The edge is now included twice. Go on with the next
|
||||||
|
operator()(startVertex, result, last, eColIdx, unused);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
result.push_back(next);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (_traverser->_iteratorCache.empty()) {
|
if (_traverser->_iteratorCache.empty()) {
|
||||||
|
@ -228,6 +235,13 @@ void ClusterTraverser::EdgeGetter::operator() (std::string const& startVertex,
|
||||||
else {
|
else {
|
||||||
std::string next = tmp.top();
|
std::string next = tmp.top();
|
||||||
tmp.pop();
|
tmp.pop();
|
||||||
|
auto search = std::find(result.begin(), result.end(), next);
|
||||||
|
if (search != result.end()) {
|
||||||
|
result.push_back(next);
|
||||||
|
// The edge is now included twice. Go on with the next
|
||||||
|
operator()(startVertex, result, last, eColIdx, unused);
|
||||||
|
return;
|
||||||
|
}
|
||||||
result.push_back(next);
|
result.push_back(next);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue