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

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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 2.0.2
    • 2.1.0
    • Shell
    • Ubuntu 11.04 x64
      Windows Server 2008 R2 x64
    • ALL

    Description

      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" ]

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: