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

mongo::Date_t::toTimeT conversion bug.

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Trivial - P5 Trivial - P5
    • None
    • 2.4.4
    • Internal Client
    • None
    • ALL

    Description

      unsigned long long is not best suitable to store date/time values because its may be negative.

      Or cast it correctly anywhere.
      file misc.h:99

      return millis / 1000;

      this makes unsigned division and return incorrect time_t for negative ( less than '1970-01-01' )

      must be:
      return static_cast<long long>( millis ) / 1000;

      Thanks.

      Attachments

        Activity

          People

            schwerin@mongodb.com Andy Schwerin
            lis82 Sergey Volkov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: