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

Mongo shell not handling \u0000 correctly

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Shell
    • None
    • ALL

      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.

      mongos> db.test.insert({_id:'y\u0000z'})
      mongos> db.test.insert({_id:'y\u0000a'})
      mongos> db.test.find()
      { "_id" : "y" }
      { "_id" : "y" }
      

      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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            charlie.page@10gen.com Charlie Page
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: