[SERVER-8330] mongoimport (v2.3.2) bug with dates before unix-epoch. throws : BSON representation of supplied JSON is too large Created: 25/Jan/13  Updated: 11/Jul/16  Resolved: 14/Feb/13

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 2.3.2
Fix Version/s: 2.4.0-rc1

Type: Bug Priority: Critical - P2
Reporter: Marc Schwering Assignee: Shaun Verch
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS X 10.7.5


Attachments: Zip Archive dump.date_issue.zip     File fail.json    
Issue Links:
Related
is related to SERVER-8573 Make Date_t::millis signed Closed
Operating System: ALL
Steps To Reproduce:

Try to import the attached data.

or:

create a document like so:

  • db.test.save( {date : new Date(1500,1)}

    )

  • export it
  • try to import it
Participants:

 Description   

I've spotted an issue importing a 2.2.2 exported collection with 2.3.2 mongoimport.

I am guessing it is because of a date before unix-epoch. (See Data below and attached files). could reproduce it with a various date before 1970

Workaround(s):

  • use mongodump / mongorestore (works fine in 2.3.2)
  • use mongoimport v. 2.2.x (tested 2.2.2, 2.2.3.rc0)

Info: It doesn't matter which mongoexport is used.

Data as in collection:

{
	"_id" : ObjectId("4eda7403a232d6a083b3aab3"),
	"description" : "Man repts. past sighting in 1957 near Mt. Baldy.  Witnessed two bright "white and blue" stars pursued by jet fighters.",
	"duration" : "",
	"geoloc" : [
		34.0239015,
		-118.1720157
	],
	"location" : "E. Los Angeles, CA",
	"reported_at" : ISODate("1995-07-25T00:00:00Z"),
	"shape" : " light",
	"sighted_at" : ISODate("1957-06-01T00:00:00Z")
}

Data as json:

{ "_id" : { "$oid" : "4eda7403a232d6a083b3aab3" }, "description" : "Man repts. past sighting in 1957 near Mt. Baldy.  Witnessed two bright "white and blue" stars pursued by jet fighters.", "duration" : "", "geoloc" : [ 34.0239015, -118.1720157 ], "location" : "E. Los Angeles, CA", "reported_at" : { "$date" : 806630400000 }, "shape" : " light", "sighted_at" : { "$date" : 18446743676528751616 } }



 Comments   
Comment by auto [ 15/Feb/13 ]

Author:

{u'date': u'2013-02-14T22:52:46Z', u'name': u'Shaun Verch', u'email': u'shaun.verch@10gen.com'}

Message: SERVER-8330 Added cstdint.h for use of int64_t in Date_t
Branch: master
https://github.com/mongodb/mongo/commit/b73eb512ad5429bce3e796e53eaeb56a70e0140a

Comment by auto [ 14/Feb/13 ]

Author:

{u'date': u'2013-02-13T22:51:41Z', u'name': u'Shaun Verch', u'email': u'shaun.verch@10gen.com'}

Message: SERVER-8330 Make jsonString ouptut a signed Date_t and make sure JSON parser can handle both new and old formats
Branch: master
https://github.com/mongodb/mongo/commit/b1a992c49c1481b097aaa42a9bf732c99d8fde88

Generated at Thu Feb 08 03:17:09 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.