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

Attempting to create a new index that already exists with diff option fails silently

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.5.1
    • Component/s: Indexing
    • Labels:
      None
    • Backwards Compatibility:
      Minor Change
    • Operating System:
      ALL

      Description

      if calling createIndex on already existing index, but with different options (like unique), no error is raised but index is not changed

      At the end of following, the index is not unique:

      foo:PRIMARY> db.test2.createIndex({c:1})
      foo:PRIMARY> db.test2.createIndex({c:1}, {unique: true})
      foo:PRIMARY> db.system.indexes.find()
      { "_id" : ObjectId("4d65b40cb91238df65f3e841"), "ns" : "mydb.test2", "key" : { "c" : 1 }, "name" : "c_1", "v" : 0 }

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                5 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: