From a6b5cdc3fa1722ea241a3d1ff9575a82e4a46081 Mon Sep 17 00:00:00 2001 From: David Storch Date: Fri, 5 Mar 2021 12:18:02 -0500 Subject: SERVER-54832 make SBE stage builder tassert() that index exists in catalog --- src/mongo/db/query/sbe_stage_builder_index_scan.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mongo/db/query/sbe_stage_builder_index_scan.cpp b/src/mongo/db/query/sbe_stage_builder_index_scan.cpp index 0ee2521b83b..863a2824ed8 100644 --- a/src/mongo/db/query/sbe_stage_builder_index_scan.cpp +++ b/src/mongo/db/query/sbe_stage_builder_index_scan.cpp @@ -687,6 +687,10 @@ std::pair, PlanStageSlots> generateIndexScan( auto descriptor = collection->getIndexCatalog()->findIndexByName(opCtx, ixn->index.identifier.catalogName); + tassert(5483200, + str::stream() << "failed to find index in catalog named: " + << ixn->index.identifier.catalogName, + descriptor); auto accessMethod = collection->getIndexCatalog()->getEntry(descriptor)->accessMethod(); auto intervals = makeIntervalsFromIndexBounds(ixn->bounds, -- cgit v1.2.1