[SERVER-31301] Shell incorrectly compares timestamps Created: 28/Sep/17  Updated: 02/Oct/17  Resolved: 28/Sep/17

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: 3.2.0, 3.4.0, 3.5.13
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Charlie Swanson Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-21861 Better Timestamp object comparison in... Closed
Operating System: ALL
Participants:

 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



 Comments   
Comment by Charlie Swanson [ 28/Sep/17 ]

Looks like this goes all the way back to at least 3.2, tested on a 3.2.6 shell and a 3.4.4 shell.

Generated at Thu Feb 08 04:26:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.