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

We must not be able to create capped collection with negative size

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.1.0
    • Affects Version/s: 2.0.2
    • Component/s: Shell
    • Environment:
      Ubuntu 11.04 x64
      Windows Server 2008 R2 x64
    • ALL

      We can create capped collection with negative size. And we can create such collection multiple times. After that we can't drop it.

      MongoDB shell version: 2.0.2
      connecting to: test
      > use testdb
      switched to db testdb
      > db.dropDatabase()
      { "dropped" : "testdb", "ok" : 1 }
      > db.getCollectionNames()
      [ ]
      > db.createCollection("tmp1", {capped: true, size: -1})
      {
      	"errmsg" : "exception: create collection invalid size spec",
      	"code" : 10083,
      	"ok" : 0
      }
      > db.getCollectionNames()
      [ "tmp1" ]
      > db.createCollection("tmp1", {capped: true, size: -1})
      {
      	"errmsg" : "exception: create collection invalid size spec",
      	"code" : 10083,
      	"ok" : 0
      }
      > db.getCollectionNames()
      [ "tmp1", "tmp1" ]
      > db.createCollection("tmp1", {capped: true, size: -1})
      {
      	"errmsg" : "exception: create collection invalid size spec",
      	"code" : 10083,
      	"ok" : 0
      }
      > db.getCollectionNames()
      [ "tmp1", "tmp1", "tmp1" ]
      > db.tmp1.drop()
      false
      > db.getCollectionNames()
      [ "tmp1", "tmp1", "tmp1" ]
      

            Assignee:
            milkie@mongodb.com Eric Milkie
            Reporter:
            uladzimir_mihura@epam.com Uladzimir Mihura
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: