Core Server
  1. Core Server
  2. SERVER-5227

Updates fail when zero-length keys exist

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor - P4 Minor - P4
    • Resolution: Duplicate
    • Affects Version/s: 2.0.3
    • Fix Version/s: None
    • Component/s: None
    • Labels:
    • Backport:
      No
    • Operating System:
      ALL
    • Bug Type:
      Logical
    • # Replies:
      2
    • Last comment by Customer:
      true

      Description

      This was reported in SERVER-2051, but appears to be a bug of its own (although the problem might be masked if the change in that ticket was made):

      > db.left.insert(

      {field1: "whatever", "": null}

      )
      > db.left.update(

      {"field1": "whatever"}

      , {$set: {"field2": "test"}}, false, true)
      LEFT_SUBFIELD only supports Object: not: 10

      On a quick look at the source, it looks like the result of compareDottedFieldNames is incorrect when r is the null string.

      Probably related:

      > db.left.insert(

      {field1: "whatever"}

      )
      > db.left.update(

      {"field1": "whatever"}

      , {$set: {"": "test"}}, false, true)
      ModSet::createNewFromMods - RIGHT_SUBFIELD should be impossible

        Activity

        Hide
        Eric Milkie
        added a comment -

        Hi Glenn.
        Does the code fix in SERVER-2651 help here?

        Show
        Eric Milkie
        added a comment - Hi Glenn. Does the code fix in SERVER-2651 help here?
        Hide
        Glenn Maynard
        added a comment -

        Looks like it works. I'll leave a note in SERVER-2051 as well. (I can't find how to close this bug. Surely reporters can close their own tickets?)

        Show
        Glenn Maynard
        added a comment - Looks like it works. I'll leave a note in SERVER-2051 as well. (I can't find how to close this bug. Surely reporters can close their own tickets?)

          People

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

            Dates

            • Created:
              Updated:
              Resolved:
              Days since reply:
              2 years, 6 weeks, 3 days ago
              Date of 1st Reply: