[SERVER-8559] Make Date_t::toString handle dates before 1970 Created: 13/Feb/13  Updated: 15/May/15  Resolved: 15/May/15

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Shaun Verch Assignee: Andy Schwerin
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by TOOLS-83 Mongoexport to CSV fails for dates be... Closed
Related
is related to SERVER-8573 Make Date_t::millis signed Closed
Operating System: ALL
Participants:

 Description   

Date_t::toString calls this function in src/mongo/bson/util/misc.h:

        time_t toTimeT() const {
            // cant use uassert from bson/util
            verify((long long)millis >= 0); // TODO when millis is signed, delete 
            verify(((long long)millis/1000) < (std::numeric_limits<time_t>::max)());
            return millis / 1000;
        }

As an example of where this problem can come up, if we call BSONElement::jsonString with pretty printing on a BSON object that has a date before 1970, we'll hit this verify.



 Comments   
Comment by Andy Schwerin [ 15/May/15 ]

Subsumed by SERVER-13874.

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