[SERVER-6079] v8 and spidermonkey handle Timestamps differently Created: 13/Jun/12  Updated: 11/Jul/16  Resolved: 04/Apr/13

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: 2.5.0

Type: Bug Priority: Minor - P4
Reporter: Greg Studer Assignee: Shaun Verch
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-9178 Timestamp does not round trip correct... Closed
is duplicated by SERVER-9732 Timestamp object is not displayed in ... Closed
Related
is related to SERVER-9175 Add more round trip jstests for javas... Closed
Operating System: ALL
Participants:

 Description   

Seems like v8 doesn't pass Timestamp objects from commands to the shell - instead is uses the object representation (

{ t : #, i : # }

)?

http://buildbot.mongodb.org:8081/builders/Linux%2064-bit%20v8/builds/3570/steps/test_10/logs/stdio/text

Basically the test was running a comparison of:

Timestamp( 1000, 2 ) + "" == admin.runCommand(

{ getShardVersion : coll + "" }

).version + ""

In spidermonkey, both are timestamps. In v8, the second is an object, and the comparison fails. If nothing else, we should be consistent between both javascript engines.



 Comments   
Comment by auto [ 08/Apr/13 ]

Author:

{u'date': u'2013-04-08T16:50:58Z', u'name': u'Shaun Verch', u'email': u'shaun.verch@10gen.com'}

Message: SERVER-6079 Avoid C style cast in Timestamp test
Branch: master
https://github.com/mongodb/mongo/commit/eaae81e7711ba0620ec56ac4600ae76e4ab819db

Comment by Shaun Verch [ 04/Apr/13 ]

I think this should be backported because Spidermonkey did it correctly and this bug was found after v8 was made the default.

Comment by auto [ 04/Apr/13 ]

Author:

{u'date': u'2013-04-03T21:01:28Z', u'name': u'Shaun Verch', u'email': u'shaun.verch@10gen.com'}

Message: SERVER-6079 Use Timestamp constructor to return BSON Timestamp to v8 shell
Branch: master
https://github.com/mongodb/mongo/commit/359d02fd8ad0a2a8d98b3bee6fd136c227885fc7

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