[SERVER-5227] Updates fail when zero-length keys exist Created: 06/Mar/12  Updated: 09/Mar/12  Resolved: 08/Mar/12

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 2.0.3
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Glenn Maynard Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: update
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 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



 Comments   
Comment by Glenn Maynard [ 08/Mar/12 ]

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?)

Comment by Eric Milkie [ 06/Mar/12 ]

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

Generated at Thu Feb 08 03:08:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.