@@ -87,6 +87,7 @@ EngineInfoContainerDBServerServerBased::TraverserEngineShardLists::TraverserEngi
8787 auto const & restrictToShards = query.queryOptions ().restrictToShards ;
8888 // Extract the local shards for edge collections.
8989 for (auto const & col : edges) {
90+ TRI_ASSERT (col != nullptr );
9091#ifdef USE_ENTERPRISE
9192 if (query.trxForOptimization ().isInaccessibleCollection (col->id ())) {
9293 _inaccessible.insert (col->name ());
@@ -103,6 +104,7 @@ EngineInfoContainerDBServerServerBased::TraverserEngineShardLists::TraverserEngi
103104 // It might in fact be empty, if we only have edge collections in a graph.
104105 // Or if we guarantee to never read vertex data.
105106 for (auto const & col : vertices) {
107+ TRI_ASSERT (col != nullptr );
106108#ifdef USE_ENTERPRISE
107109 if (query.trxForOptimization ().isInaccessibleCollection (col->id ())) {
108110 _inaccessible.insert (col->name ());
@@ -120,7 +122,11 @@ std::vector<ShardID> EngineInfoContainerDBServerServerBased::TraverserEngineShar
120122 std::vector<ShardID> localShards;
121123 for (auto const & shard : *shardIds) {
122124 auto const & it = shardMapping.find (shard);
123- TRI_ASSERT (it != shardMapping.end ());
125+ if (it == shardMapping.end ()) {
126+ THROW_ARANGO_EXCEPTION_MESSAGE (
127+ TRI_ERROR_INTERNAL,
128+ " no entry for shard '" + shard + " ' in shard mapping table (" + std::to_string (shardMapping.size ()) + " entries)" );
129+ }
124130 if (it->second == server) {
125131 localShards.emplace_back (shard);
126132 _hasShard = true ;
@@ -853,15 +859,15 @@ void EngineInfoContainerDBServerServerBased::addOptionsPart(arangodb::velocypack
853859#endif
854860}
855861
856- // Insert the Variables information into the message to be send to DBServers
862+ // Insert the Variables information into the message to be sent to DBServers
857863void EngineInfoContainerDBServerServerBased::addVariablesPart (arangodb::velocypack::Builder& builder) const {
858864 TRI_ASSERT (builder.isOpenObject ());
859865 builder.add (VPackValue (" variables" ));
860866 // This will open and close an Object.
861867 _query.ast ()->variables ()->toVelocyPack (builder);
862868}
863869
864- // Insert the Snippets information into the message to be send to DBServers
870+ // Insert the Snippets information into the message to be sent to DBServers
865871void EngineInfoContainerDBServerServerBased::addSnippetPart (
866872 std::unordered_map<ExecutionNodeId, ExecutionNode*> const & nodesById,
867873 arangodb::velocypack::Builder& builder, ShardLocking& shardLocking,
@@ -875,7 +881,7 @@ void EngineInfoContainerDBServerServerBased::addSnippetPart(
875881 builder.close (); // snippets
876882}
877883
878- // Insert the TraversalEngine information into the message to be send to DBServers
884+ // Insert the TraversalEngine information into the message to be sent to DBServers
879885std::vector<bool > EngineInfoContainerDBServerServerBased::addTraversalEnginesPart (
880886 arangodb::velocypack::Builder& infoBuilder,
881887 std::unordered_map<ShardID, ServerID> const & shardMapping, ServerID const & server) const {
0 commit comments