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

Shell incorrectly compares timestamps

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Duplicate
    • 3.2.0, 3.4.0, 3.5.13
    • None
    • Shell
    • None
    • ALL

    Description

      It looks like the shell is using some sort of string comparison for Timestamps that have the same ts but different offset, instead of a numeric comparison:

      > Timestamp(1506527690, 11) > Timestamp(1506527690, 9)
      false
      > Timestamp(1506527690, 11) >= Timestamp(1506527690, 9)
      false
      > Timestamp(1506527690, 11) < Timestamp(1506527690, 9)
      true
      > Timestamp(1506527690, 1) < Timestamp(1506527690, 9)
      true
      > Timestamp(1506527690, 10) < Timestamp(1506527690, 9)
      true
      > Timestamp(1506527690, 100) < Timestamp(1506527690, 9)
      true
      > Timestamp(1506527690, 900) < Timestamp(1506527690, 9)
      false
      

      Attachments

        Issue Links

          Activity

            People

              backlog-server-platform DO NOT USE - Backlog - Platform Team
              charlie.swanson@mongodb.com Charlie Swanson
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: