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

renameCollection permits creation of a collection which begins with "."

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.7.0
    • Component/s: Catalog
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Linked BF Score:
      9

      Description

      > db.foo.insert({x: 1})
      WriteResult({ "nInserted" : 1 })
      > db.foo.renameCollection(".")
      { "ok" : 1 }
      > db.listCollections()
      uncaught exception: TypeError: db.listCollections is not a function :
      @(shell):1:1
      > show tables
      .
      bug
      > db[".foo"].insert({x: 1})
      WriteCommandError({
      	"ok" : 0,
      	"errmsg" : "Collection names cannot start with '.'",
      	"code" : 73,
      	"codeName" : "InvalidNamespace"
      })
      

      It seems like we're just missing some validation on the target namespace.

        Attachments

          Activity

            People

            Assignee:
            katherine.wu Katherine Wu
            Reporter:
            charlie.swanson Charlie Swanson
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: