1
0
Fork 0

Merge branch 'devel' of https://github.com/arangodb/arangodb into devel

This commit is contained in:
jsteemann 2016-06-24 17:24:00 +02:00
commit c18ec8589b
2 changed files with 21 additions and 7 deletions

View File

@ -3186,8 +3186,10 @@ AqlValue Functions::Shift(arangodb::aql::Query* query,
auto iterator = VPackArrayIterator(l);
// This jumps over the first element
while (iterator.next()) {
iterator.next();
while (iterator.valid()) {
builder->add(iterator.value());
iterator.next();
}
}
builder->close();

View File

@ -108,14 +108,26 @@ Graph::Graph(VPackSlice const& info) : _vertexColls(), _edgeColls() {
for (auto const& def : VPackArrayIterator(edgeDefs)) {
TRI_ASSERT(def.isObject());
std::string eCol = arangodb::basics::VelocyPackHelper::getStringValue(
try {
std::string eCol = arangodb::basics::VelocyPackHelper::getStringValue(
def, "collection", "");
addEdgeCollection(eCol);
addEdgeCollection(eCol);
} catch (...) {
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_GRAPH_INVALID_GRAPH, "didn't find 'collection' in the graph definition");
}
// TODO what if graph is not in a valid format any more
VPackSlice tmp = def.get("from");
insertVertexCollections(tmp);
tmp = def.get("to");
insertVertexCollections(tmp);
try {
VPackSlice tmp = def.get("from");
insertVertexCollections(tmp);
} catch (...) {
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_GRAPH_INVALID_GRAPH, "didn't find from-collection in the graph definition");
}
try {
VPackSlice tmp = def.get("to");
insertVertexCollections(tmp);
} catch (...) {
THROW_ARANGO_EXCEPTION_MESSAGE(TRI_ERROR_GRAPH_INVALID_GRAPH, "didn't find to-collection in the graph definition");
}
}
}
if (slice.hasKey(_attrOrphans)) {