small error typo, maybe

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor - P4
    • 8.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Engines - Server Integration
    • Fully Compatible
    • ALL
    • PastaLaVista - 2025-03-18, pro-duck-tive - 2025-04-01
    • 0
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      https://github.com/mongodb/mongo/blob/0a68308f0d39a928ed551f285ba72ca560c38576/src/mongo/db/catalog/index_key_validate.cpp#L426-L441

      I think line 439 should be IndexDescriptor::kHiddenFieldName, not IndexDescriptor::kIndexNameFieldName

              } else if (IndexDescriptor::kIndexNameFieldName == indexSpecElemFieldName) {
                  if (indexSpecElem.type() != BSONType::String) {
                      return {ErrorCodes::TypeMismatch,
                              str::stream()
                                  << "The field '" << IndexDescriptor::kIndexNameFieldName
                                  << "' must be a string, but got " << typeName(indexSpecElem.type())};
                  }
      
                  hasIndexNameField = true;
              } else if (IndexDescriptor::kHiddenFieldName == indexSpecElemFieldName) {
                  if (indexSpecElem.type() != BSONType::Bool) {
                      return {ErrorCodes::TypeMismatch,
                              str::stream()
                             // HERE - I think this message should refer to kHiddenFieldName
                                  << "The field '" << IndexDescriptor::kIndexNameFieldName
                                  << "' must be a bool, but got " << typeName(indexSpecElem.type())};
                  }
      

            Assignee:
            Adeline Chen
            Reporter:
            Jeff Alder (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: