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

UTF8 null character \u0000 in the middle of a string is not handled correctly

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major - P3 Major - P3
    • None
    • 1.8.0
    • Querying
    • None
    • Suse Linux Entreprise Server x86_64 10.3
    • ALL

    Description

      Hello,

      The valid UTF8 character \u0000 is not handled properly : the string is cut at this character. Mongo is probably interpreting it as a string terminating character.
      Example :

      MongoDB shell version: 1.8.0
      connecting to: test
      > db.test.save(

      {'text': 'foo\u0000bar'}

      )
      > db.test.findOne()

      { "_id" : ObjectId("4e3bbbaa4e496a38200a6f81"), "text" : "foo" }

      > db.test.findOne(

      {text: /foo/}

      )

      { "_id" : ObjectId("4e3bbbaa4e496a38200a6f81"), "text" : "foo" }

      > db.test.findOne(

      {text: /bar/}

      )
      null

      We use Mongo to log errors from various servers. We do not have any control on the string characters incoming and we have no workaround for this issue so far.
      Thank you very much in advance for your feedback on this issue.

      Cheers,
      CH.

      Attachments

        Activity

          People

            Unassigned Unassigned
            cdadhemar Charles-Henri d'Adhémar
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: