AutoGetCollectionForReadCommandMaybeLockFree operator bool not consistent with AutoGetCollectionForReadCommandMaybeLockFree::getCollection operator bool

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Works as Designed
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • ALL
    • Execution Team 2022-03-07
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      AutoGetCollectionForReadCommandMaybeLockFree::operator bool is supposed to be a shortcut to AutoGetCollectionForReadCommandMaybeLockFree::getCollection::operator bool, i.e. it returns true if a collection with the provided namespace exists, or false otherwise. However, in the case where such a collection does not exists, it appears that it is not behaving as expected:

      AutoGetCollectionForReadCommandMaybeLockFree coll{...};  // Collection does not exist
      logd("coll {} coll->getCollection() {}",
           static_cast<bool>(coll),
           static_cast<bool>(coll->getCollection()));
      
      coll true coll->getCollection() false
      

            Assignee:
            Gregory Noma
            Reporter:
            Gregory Noma
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: