[SERVER-21160] Timestamp comparison is not unsigned since 3.1.x Created: 27/Oct/15  Updated: 04/Nov/15  Resolved: 29/Oct/15

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 3.1.3, 3.2.0-rc0, 3.2.0-rc1
Fix Version/s: 3.2.0-rc2

Type: Bug Priority: Major - P3
Reporter: Geert Bosch Assignee: Geert Bosch
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-15508 Do not rollover negative timestamp va... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

// Check that timestamp comparisons are unsigned
(function() {
    'use strict';
    var t = db.compare_timestamps;
    t.drop();
    assert.writeOK(t.insert({a: new Timestamp(-2, 3), b:"non-zero"}));
    assert.writeOK(t.insert({a: new Timestamp(0, 0), b:"zero"}));
    assert.eq(t.find().sort({a:1}).limit(1).next().b, "zero", "timestamp comparison must be unsigned");
}());

Sprint: QuInt B (11/02/15)
Participants:

 Description   

When the date_t type was made to contain the unsigned count of millis, Timestamp inadvertently changed to use signed comparison though it is documented and intended to be unsigned.



 Comments   
Comment by Githook User [ 30/Oct/15 ]

Author:

{u'username': u'GeertBosch', u'name': u'Geert Bosch', u'email': u'geert@mongodb.com'}

Message: SERVER-21160: revert woCompare to using unsigned comparison for Timestamp
Branch: master
https://github.com/mongodb/mongo/commit/9ac7b65d0e33ac778a0c9febf96f04ee54570fbc

Comment by Githook User [ 29/Oct/15 ]

Author:

{u'username': u'GeertBosch', u'name': u'Geert Bosch', u'email': u'geert@mongodb.com'}

Message: Revert "SERVER-21160: revert woCompare to using unsigned comparison for Timestamp"

This reverts commit adcef363bccdb179e448b47e18ba5541d9a60eab.
Branch: master
https://github.com/mongodb/mongo/commit/4aa1aa00f4f19921101c2ed540247f06f00e21ea

Comment by Githook User [ 29/Oct/15 ]

Author:

{u'username': u'GeertBosch', u'name': u'Geert Bosch', u'email': u'geert@mongodb.com'}

Message: SERVER-21160: revert woCompare to using unsigned comparison for Timestamp
Branch: master
https://github.com/mongodb/mongo/commit/adcef363bccdb179e448b47e18ba5541d9a60eab

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