Skip to content

Commit

Permalink
Fixed if you execute "go from xx over *", and when there is no edge u…
Browse files Browse the repository at this point in the history
…nder a space, (vesoft-inc#1983)

an unreasonable error message is returned (SpaceId `xxx 'is nonexistent)

Co-authored-by: dutor <[email protected]>
  • Loading branch information
monadbobo and dutor authored Mar 30, 2020
1 parent 89b5341 commit 7d0cea6
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/meta/client/MetaClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ bool MetaClient::loadSchemas(GraphSpaceID spaceId,
return false;
}

allEdgeMap[spaceId] = {};
auto tagItemVec = tagRet.value();
auto edgeItemVec = edgeRet.value();
TagSchemas tagSchemas;
Expand Down Expand Up @@ -301,18 +302,11 @@ bool MetaClient::loadSchemas(GraphSpaceID spaceId,
edgeSchemas.emplace(std::make_pair(edgeIt.edge_type, edgeIt.version), schema);
edgeNameTypeMap.emplace(std::make_pair(spaceId, edgeIt.edge_name), edgeIt.edge_type);
edgeTypeNameMap.emplace(std::make_pair(spaceId, edgeIt.edge_type), edgeIt.edge_name);
auto it = allEdgeMap.find(spaceId);
if (it == allEdgeMap.end()) {
std::vector<std::string> v = {edgeIt.edge_name};
allEdgeMap.emplace(spaceId, std::move(v));
edges.emplace(spaceId, edgeIt.edge_type);
} else {
if (edges.find({spaceId, edgeIt.edge_type}) != edges.cend()) {
continue;
}
edges.emplace(spaceId, edgeIt.edge_type);
it->second.emplace_back(edgeIt.edge_name);
if (edges.find({spaceId, edgeIt.edge_type}) != edges.cend()) {
continue;
}
edges.emplace(spaceId, edgeIt.edge_type);
allEdgeMap[spaceId].emplace_back(edgeIt.edge_name);
// get the latest edge version
auto it2 = newestEdgeVerMap.find(std::make_pair(spaceId, edgeIt.edge_type));
if (it2 != newestEdgeVerMap.end()) {
Expand Down

0 comments on commit 7d0cea6

Please sign in to comment.