Core Server
  1. Core Server
  2. SERVER-961

mongoimport fails when record contains dates before epoch with "Assertion: 10338:Invalid use of reserved field name"

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major - P3 Major - P3
    • Resolution: Unresolved
    • Affects Version/s: 1.4.0
    • Fix Version/s: Planning Bucket C
    • Component/s: Tools
    • Labels:
    • Environment:
      OS X Snow Leopard, Windows 2003 R2 (32-bit)
    • Backport:
      No
    • # Replies:
      3
    • Last comment by Customer:
      false

      Description

      When importing JSON files containing dates before epoch, import fails with "Assertion: 10338:Invalid use of reserved field name"

      Repro steps:

      ~>: echo '{ "d":

      {"$date":-1}

      }' > before_epoch.json
      ~>: cat before_epoch.json
      { "d":

      {"$date":-1}

      }
      ~>: bin/mongoimport -d test -c date2 --file before_epoch.json
      Mon Apr 5 09:43:37 Assertion: 10338:Invalid use of reserved field name

      Reproduced on OS X 1.4.0-x64, 1.5.1-pre-x64, Windows 2003R2 v1.4.0-x32

        Issue Links

          Activity

          Hide
          Jake Wharton
          added a comment -

          The assertion failure occurs at https://github.com/mongodb/mongo/blob/master/db/json.cpp#L229
          because of https://github.com/mongodb/mongo/blob/master/db/json.cpp#L527-L530
          using an unsigned integer parser.

          I'm going to take a look at it and see if I can update it to correctly interpret signed values.

          Show
          Jake Wharton
          added a comment - The assertion failure occurs at https://github.com/mongodb/mongo/blob/master/db/json.cpp#L229 because of https://github.com/mongodb/mongo/blob/master/db/json.cpp#L527-L530 using an unsigned integer parser. I'm going to take a look at it and see if I can update it to correctly interpret signed values.
          Hide
          Bjarte Stien Karlsen
          added a comment -

          Greetings,

          I am still seeing this issue in 2.0.4. My notes are here in this gist: https://gist.github.com/2314294

          It works when i create a new Date in mongoshell but not when importing is the gist of it.

          Show
          Bjarte Stien Karlsen
          added a comment - Greetings, I am still seeing this issue in 2.0.4. My notes are here in this gist: https://gist.github.com/2314294 It works when i create a new Date in mongoshell but not when importing is the gist of it.
          Hide
          Eliot Horowitz
          added a comment -

          Note this bug has not been marked fixed yet.

          Show
          Eliot Horowitz
          added a comment - Note this bug has not been marked fixed yet.

            People

            • Votes:
              15 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

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