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

Prevent Timestamp comparison mistakes in the shell

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Shell
    • Labels:
      None

      Description

      It's easy to think that Timestamp objects are comparable in the shell:

      > Timestamp(1, 9) > Timestamp(1, 8)
      true
      

      But they are not:

      > Timestamp(1, 9) > Timestamp(1, 10)
      true
      

      I don't know what the rules are for comparing Timestamps, but they're not correct. This leads to bugs like SERVER-41008. Let's either fix comparison, or make comparison operators throw an error so we remember to use timestampCmp from shell/utils.js.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              backlog-server-stm Backlog - Server Tooling and Methods (STM)
              Reporter:
              jesse A. Jesse Jiryu Davis
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: