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

DurableViewCatalog shouldn't throw on null byte in view ns

    XMLWordPrintableJSON

Details

    • Fully Compatible
    • ALL
    • v3.4
    • Hide

      > db.createCollection("coll")
      { "ok" : 1 }
      > db.system.views.insert({_id: "\0"})
      WriteResult({ "nInserted" : 1 })
      > db.getCollectionInfos()
      2017-02-27T11:46:56.558-0500 E QUERY    [main] Error: listCollections failed: {
      	"ok" : 0,
      	"errmsg" : "namespaces cannot have embedded null characters",
      	"code" : 73,
      	"codeName" : "InvalidNamespace"
      } :
      _getErrorWithCode@src/mongo/shell/utils.js:25:13
      DB.prototype._getCollectionInfosCommand@src/mongo/shell/db.js:805:1
      DB.prototype.getCollectionInfos@src/mongo/shell/db.js:817:19
      @(shell):1:1
      

      Show
      > db.createCollection("coll") { "ok" : 1 } > db.system.views.insert({_id: "\0"}) WriteResult({ "nInserted" : 1 }) > db.getCollectionInfos() 2017-02-27T11:46:56.558-0500 E QUERY [main] Error: listCollections failed: { "ok" : 0, "errmsg" : "namespaces cannot have embedded null characters", "code" : 73, "codeName" : "InvalidNamespace" } : _getErrorWithCode@src/mongo/shell/utils.js:25:13 DB.prototype._getCollectionInfosCommand@src/mongo/shell/db.js:805:1 DB.prototype.getCollectionInfos@src/mongo/shell/db.js:817:19 @(shell):1:1
    • Query 2017-03-27
    • 0

    Description

      Inserting a null byte into a system.views namespace is allowed but should cause operations against that view to fail with InvalidViewDefinition. It should also not prevent mongod startup, which is the case here.

      Attachments

        Activity

          People

            james.wahlin@mongodb.com James Wahlin
            tess.avitabile@mongodb.com Tess Avitabile (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: