From 90caba6b07d4b606f6d4641a398a529926aba2ce Mon Sep 17 00:00:00 2001 From: Rui Liu Date: Mon, 14 Mar 2022 20:21:38 +0000 Subject: SERVER-64474 Add null pointer assertion for index descriptor access during index join --- src/mongo/db/query/sbe_stage_builder_lookup.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mongo/db/query/sbe_stage_builder_lookup.cpp b/src/mongo/db/query/sbe_stage_builder_lookup.cpp index 9d682c7efb7..e42c75f868e 100644 --- a/src/mongo/db/query/sbe_stage_builder_lookup.cpp +++ b/src/mongo/db/query/sbe_stage_builder_lookup.cpp @@ -283,6 +283,10 @@ std::pair> buildIndexJoinLookupStage( const auto indexName = index.identifier.catalogName; const auto indexDescriptor = foreignColl->getIndexCatalog()->findIndexByName(state.opCtx, indexName); + tassert(6447401, + str::stream() << "Index " << indexName + << " should is unexpectedly missing for $lookup index join", + indexDescriptor); const auto indexAccessMethod = foreignColl->getIndexCatalog()->getEntry(indexDescriptor)->accessMethod()->asSortedData(); const auto indexVersion = indexAccessMethod->getSortedDataInterface()->getKeyStringVersion(); -- cgit v1.2.1