1
0
Fork 0

Merge branch 'devel' of ssh://github.com/ArangoDB/ArangoDB into devel

This commit is contained in:
Max Neunhoeffer 2015-12-16 10:59:18 +01:00
commit 5a350b4391
4 changed files with 24 additions and 7 deletions

View File

@ -220,7 +220,7 @@ void ClusterTraverser::EdgeGetter::operator() (std::string const& startVertex,
_traverser->_iteratorCache.emplace(stack);
auto search = std::find(result.begin(), result.end(), next);
if (search != result.end()) {
result.push_back(next);
// result.push_back(next);
// The edge is now included twice. Go on with the next
operator()(startVertex, result, last, eColIdx, unused);
return;
@ -245,7 +245,7 @@ void ClusterTraverser::EdgeGetter::operator() (std::string const& startVertex,
tmp.pop();
auto search = std::find(result.begin(), result.end(), next);
if (search != result.end()) {
result.push_back(next);
// result.push_back(next);
// The edge is now included twice. Go on with the next
operator()(startVertex, result, last, eColIdx, unused);
return;

View File

@ -969,7 +969,7 @@ void DepthFirstTraverser::_defInternalFunctions () {
}
auto search = std::find(edges.begin(), edges.end(), e);
if (search != edges.end()) {
edges.push_back(e);
// edges.push_back(e);
// The edge is now included twice. Go on with the next
_getEdge(startVertex, edges, last, eColIdx, dir);
return;
@ -1018,7 +1018,7 @@ void DepthFirstTraverser::_defInternalFunctions () {
}
auto search = std::find(edges.begin(), edges.end(), e);
if (search != edges.end()) {
edges.push_back(e);
// edges.push_back(e);
// The edge is now included twice. Go on with the next
_getEdge(startVertex, edges, last, eColIdx, dir);
return;

View File

@ -318,15 +318,31 @@ function namedGraphSuite () {
var result = db._query(query, bindVars).toArray();
assertEqual(result.length, 0);
query = "FOR x IN 2 ANY @startId GRAPH @graph SORT x._id ASC RETURN x._id";
query = "FOR x, e, p IN 2 ANY @startId GRAPH @graph SORT x._id ASC RETURN {v: x._id, edges: p.edges, vertices: p.vertices}";
result = db._query(query, bindVars).toArray();
// result: A->B->C
// result: A->B<-E
// Invalid result: A->B<-A
assertEqual(result.length, 2);
assertEqual(result[0], vertex.C);
assertEqual(result[1], vertex.E);
assertEqual(result[0].v, vertex.C);
assertEqual(result[0].edges.length, 2);
assertEqual(result[0].edges[0]._id, edge.AB);
assertEqual(result[0].edges[1]._id, edge.BC);
assertEqual(result[0].vertices.length, 3);
assertEqual(result[0].vertices[0]._id, vertex.A);
assertEqual(result[0].vertices[1]._id, vertex.B);
assertEqual(result[0].vertices[2]._id, vertex.C);
assertEqual(result[1].v, vertex.E);
assertEqual(result[1].edges.length, 2);
assertEqual(result[1].edges[0]._id, edge.AB);
assertEqual(result[1].edges[1]._id, edge.EB);
assertEqual(result[1].vertices.length, 3);
assertEqual(result[1].vertices[0]._id, vertex.A);
assertEqual(result[1].vertices[1]._id, vertex.B);
assertEqual(result[1].vertices[2]._id, vertex.E);
query = `FOR x IN 1 ANY @startId GRAPH @graph
FOR y IN 1 ANY x GRAPH @graph

View File

@ -1348,6 +1348,7 @@ namespace triagens {
vertexIdentifier v;
bool isValid = _getVertex(_enumeratedPath.edges.back(), _enumeratedPath.vertices.back(), _enumeratedPath.vertices.size(), v);
_enumeratedPath.vertices.push_back(v);
TRI_ASSERT(_enumeratedPath.vertices.size() == _enumeratedPath.edges.size() + 1);
if (! isValid) {
prune();
return next();