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

Duplicate key error message does not contain index name anymore

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.0.2, 3.1.0
    • Component/s: WiredTiger
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Completed:
    • Steps To Reproduce:
      Hide

      In mongo shell:

      db.test.insert({_id: "test"})
      db.test.insert({_id: "test"})
      

      Result with WiredTiger:

      WriteResult({
      	"nInserted" : 0,
      	"writeError" : {
      		"code" : 11000,
      		"errmsg" : "E11000 duplicate key error dup key: { : \"test\" }"
      	}
      })
      

      Result with MMAPv1:

      WriteResult({
      	"nInserted" : 0,
      	"writeError" : {
      		"code" : 11000,
      		"errmsg" : "E11000 duplicate key error index: rfy.test.$_id_ dup key: { : \"test\" }"
      	}
      })
      

      Show
      In mongo shell: db.test.insert({_id: "test"}) db.test.insert({_id: "test"}) Result with WiredTiger: WriteResult({ "nInserted" : 0, "writeError" : { "code" : 11000, "errmsg" : "E11000 duplicate key error dup key: { : \"test\" }" } }) Result with MMAPv1: WriteResult({ "nInserted" : 0, "writeError" : { "code" : 11000, "errmsg" : "E11000 duplicate key error index: rfy.test.$_id_ dup key: { : \"test\" }" } })

      Description

      With WiredTiger, the error returned by a duplicate key does not contain the name of the violated unique index. It is therefore not possible to identify which field in the inserted document causes the violation.

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: