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

Cannot export to CSV dates prior 1970

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.2.1
    • Component/s: None
    • None
    • Environment:
      OSX, Linux
    • ALL
    • Hide

      > db.test.insert({_id:1,birthdate:ISODate("1963-10-08T00:41:45+0000")});
      > db.test.find();

      { "_id" : 1, "birthdate" : ISODate("1963-10-08T00:41:45Z") }

      ./mongoexport -d bie -c test --csv -f "_id,birthdate" -o test.csv

      Show
      > db.test.insert({_id:1,birthdate:ISODate("1963-10-08T00:41:45+0000")}); > db.test.find(); { "_id" : 1, "birthdate" : ISODate("1963-10-08T00:41:45Z") } ./mongoexport -d bie -c test --csv -f "_id,birthdate" -o test.csv

      The exporting to CSV fails when the date is prior 1970

      macmini2:bin intelligenx$ ./mongoexport -d bie -c test --csv -f "_id,birthdate" -o test.csv
      connected to: 127.0.0.1
      Tue Nov 20 13:30:06 Fatal Assertion 16227
      0x100042f9b 0x10003b4f5 0x10059c962 0x10005d7d6 0x10005faa1 0x100562737 0x10005640a 0x1000563c8
      0 mongoexport 0x0000000100042f9b _ZN5mongo15printStackTraceERSo + 43
      1 mongoexport 0x000000010003b4f5 _ZN5mongo13fassertFailedEi + 165
      2 mongoexport 0x000000010059c962 _ZN5mongo15timeToISOStringEl + 162
      3 mongoexport 0x000000010005d7d6 _ZN6Export9csvStringERKN5mongo11BSONElementE + 1318
      4 mongoexport 0x000000010005faa1 _ZN6Export3runEv + 3137
      5 mongoexport 0x0000000100562737 _ZN5mongo4Tool4mainEiPPc + 5447
      6 mongoexport 0x000000010005640a main + 58
      7 mongoexport 0x00000001000563c8 start + 52
      Tue Nov 20 13:30:06

      ***aborting after fassert() failure

      In mongo 2.0.2

      Tue Nov 20 13:37:37 Assertion failure strftime(buf, sizeof(buf), fmt, &t) == 20 ./client/../util/net/../../db/../util/../db/../util/concurrency/../time_support.h 61
      0x577426 0x581f6b 0xaa1905 0xaa3171 0xa9c66d 0xaa02d2 0x7f978464376d 0x4fe709
      mongoexport(_ZN5mongo12sayDbContextEPKc+0x96) [0x577426]
      mongoexport(_ZN5mongo8assertedEPKcS1_j+0xfb) [0x581f6b]
      mongoexport(_ZN6Export9csvStringERKN5mongo11BSONElementE+0xb65) [0xaa1905]
      mongoexport(_ZN6Export3runEv+0xb51) [0xaa3171]
      mongoexport(_ZN5mongo4Tool4mainEiPPc+0x169d) [0xa9c66d]
      mongoexport(main+0x32) [0xaa02d2]
      /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7f978464376d]
      mongoexport(__gxx_personality_v0+0x3d1) [0x4fe709]
      assertion: 0 assertion ./client/../util/net/../../db/../util/../db/../util/concurrency/../time_support.h:61

            Assignee:
            Unassigned Unassigned
            Reporter:
            praffo Pablo Raffo
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: