Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-71477

Check '_internalAllCollectionStatsSpec.getStats()' exists (boost::optional) before calling 'makeStatsForNs' in 'document_source_internal_all_collection_stats.cpp'

    • Fully Compatible
    • ALL
    • v6.2, v6.1, v6.0
    • Sharding EMEA 2022-11-28
    • 143

      In order to solve this bug we must check that '_internalAllCollectionStatsSpec.getStats()' exists before calling 'makeStatsForNs' in 'document_source_internal_all_collection_stats.cpp':

      if (const auto& specs = _internalAllCollectionStatsSpec.getStats()) {
          try {
              return {Document{DocumentSourceCollStats::makeStatsForNs(
                  pExpCtx, nss, specs.get(), _projectFilter)}};
          } catch (const ExceptionFor<ErrorCodes::CommandNotSupportedOnView>&) {
             continue;
          }
      }
      

            Assignee:
            pol.pinol@mongodb.com Pol Pinol
            Reporter:
            pol.pinol@mongodb.com Pol Pinol
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: