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

NumberDecimal values can be inserted in legacy write mode when featureCompatibilityVersion is 3.2

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.3.5
    • Fix Version/s: 3.3.14
    • Component/s: Write Ops
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Sprint:
      Query 2016-09-19
    • Linked BF Score:
      0

      Description

      When featureCompatibilityVersion is 3.2, it should be an error to insert documents containing NumberDecimal values in legacy write mode.

      Previous description:
      Documents that contain NumberDecimal values can be inserted in legacy write mode. The same documents cannot be inserted when using write command mode.

      var coll = db.foo;
      coll.drop();
       
      // The write fails when using write commands:
      // "Attempt to use a decimal BSON type when support is not currently enabled."
      assert.writeError(coll.insert({a: NumberDecimal(2.0)}));
      assert.eq(coll.count(), 0);
       
      // The write succeeds when using legacy writes.
      db.getMongo().forceWriteMode('legacy');
      coll.insert({a: NumberDecimal(2.0)});
       
      // This assertion fails because there's a document present.
      assert.eq(coll.count(), 0);
      

        Attachments

          Activity

            People

            Assignee:
            tess.avitabile Tess Avitabile
            Reporter:
            kamran.khan Kamran K.
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: