summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRui Liu <rui.liu@mongodb.com>2022-03-14 20:21:38 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-03-14 21:41:01 +0000
commit90caba6b07d4b606f6d4641a398a529926aba2ce (patch)
tree12a6761f1aca52bc2f4ed8ab7bc0fdb69a3a0beb
parent6e8396defc08b1cf399e38a0409092b86c6bd725 (diff)
downloadmongo-90caba6b07d4b606f6d4641a398a529926aba2ce.tar.gz
SERVER-64474 Add null pointer assertion for index descriptor access during index join
-rw-r--r--src/mongo/db/query/sbe_stage_builder_lookup.cpp4
1 files changed, 4 insertions, 0 deletions
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<SlotId, std::unique_ptr<sbe::PlanStage>> 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();