diff options
author | Justin Seyster <justin.seyster@mongodb.com> | 2018-05-18 16:16:29 -0400 |
---|---|---|
committer | Justin Seyster <justin.seyster@mongodb.com> | 2018-05-22 18:29:41 -0400 |
commit | a9deb701a7533b566a2eb703aff70bf2f03b147c (patch) | |
tree | cc615998ab87302fe3d1b725ff8580d12834670b /src/mongo/bson/oid.h | |
parent | adad00367e75e7c71a781e4610321f7be5d98aa6 (diff) | |
download | mongo-a9deb701a7533b566a2eb703aff70bf2f03b147c.tar.gz |
SERVER-34975 Treat an OID-embedded timestamp as unsigned.
Diffstat (limited to 'src/mongo/bson/oid.h')
-rw-r--r-- | src/mongo/bson/oid.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mongo/bson/oid.h b/src/mongo/bson/oid.h index 4474a12dbe2..7f4f31a4369 100644 --- a/src/mongo/bson/oid.h +++ b/src/mongo/bson/oid.h @@ -176,9 +176,8 @@ public: */ void initFromTermNumber(int64_t term); - time_t asTimeT() const; Date_t asDateT() const { - return Date_t::fromMillisSinceEpoch(asTimeT() * 1000LL); + return Date_t::fromMillisSinceEpoch(getTimestamp() * 1000LL); } // True iff the OID is not empty @@ -198,8 +197,8 @@ public: static unsigned getMachineId(); // used by the 'features' command static void regenMachineId(); - // Timestamp is 4 bytes so we just use int32_t - typedef int32_t Timestamp; + // Timestamp is a 4-byte positive integer so we use uint32_t + typedef uint32_t Timestamp; // Wrappers so we can return stuff by value. struct InstanceUnique { |