[SERVER-12756] Mongo shell not handling \u0000 correctly Created: 17/Feb/14 Updated: 05/Feb/16 Resolved: 05/Feb/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Charlie Page | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Operating System: | ALL | ||||||||||||
| Participants: | |||||||||||||
| Description |
|
The drivers allow null to be inserted into strings for values. The shell doesn't properly interpret the value and truncates at the null for strings. This creates problems with values inserted by the java driver for instance that are then examined in the shell.
It's extremely confusing to users to see unique indexes apparently not operating as such. Not to mention inserting these documents into another collection is also not possible using the shell as they have the "same" unique index value. |
| Comments |
| Comment by Max Hirschhorn [ 05/Feb/16 ] | ||||||||||||||||||||||||
Behavior in 2.4.0-rc2
Behavior in 2.5.0
Behavior in 2.4.14 (
|
MongoDB shell version: 2.4.14
|
> db.test.find()
|
{ "_id" : "y" }
|
{ "_id" : "y" }
|
MongoDB shell version: 2.6.11
|
> db.test.find()
|
{ "_id" : "y\u0000z" }
|
{ "_id" : "y\u0000a" }
|
MongoDB shell version: 3.0.9
|
> db.test.find()
|
{ "_id" : "y\u0000z" }
|
{ "_id" : "y\u0000a" }
|
MongoDB shell version: 3.2.1
|
> db.test.find()
|
{ "_id" : "y\u0000z" }
|
{ "_id" : "y\u0000a" }
|