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

strings that are ns's should be validated by the NamespaceString class

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 3.3.5
    • 3.3.3
    • Internal Code
    • None
    • Fully Compatible
    • ALL
    • TIG 13 (04/22/16)

    Description

      Validation for namespace strings are currently scattered throughout the codebase, some of which make incorrect assumptions. We should encapsulate the checks by having them call methods on NamespaceString.

      Here's a few of them:

      ➜  mongo git:(master) ✗ ack "find\('\\\$'\)"
       
      db/catalog/collection.cpp
      208:    if (_ns.ns().find('$') != string::npos) {
       
      db/dbcommands.cpp
      473:        if (nsToDrop.find('$') != string::npos) {
       
      db/query/get_executor.cpp
      650:        if (nss.ns().find('$') != string::npos) {
       
      db/storage/mmap_v1/record_store_v1_base.cpp
      259:    if (delRecLength >= 32 * 1024 && _ns.find('$') != string::npos && !isCapped()) {
      

      Attachments

        Activity

          People

            robert.guo@mongodb.com Robert Guo (Inactive)
            robert.guo@mongodb.com Robert Guo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: