[SERVER-14891] Shell will create invalid dates and then persist them Created: 13/Aug/14 Updated: 10/May/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | 2.7.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Alvin Richards (Inactive) | Assignee: | DO NOT USE - Backlog - Platform Team |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | 28qa, move-sa, neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Minor Change | ||||||||
| Operating System: | ALL | ||||||||
| Steps To Reproduce: | In the shell
|
||||||||
| Participants: | |||||||||
| Description |
|
Problem:
An octal dump of the .bson file from mongodump reveals
|
| Comments |
| Comment by Steven Vannelli [ 10/May/22 ] | ||||||||||
|
Moving this ticket to the Backlog and removing the "Backlog" fixVersion as per our latest policy for using fixVersions. | ||||||||||
| Comment by Matt Kangas [ 28/Aug/14 ] | ||||||||||
|
Even simpler reproduction:
Also:
It's not unique to our shell; both Firefox and Chrome exhibit the same behavior. JavaScript simply permits "NaN" Dates, but we should prohibit them from being serialized to (invalid) BSON. This will be a minor backwards incompatibility for the shell. | ||||||||||
| Comment by J Rassi [ 13/Aug/14 ] | ||||||||||
|
behackett: right, of course it's signed, my mistake. | ||||||||||
| Comment by Bernie Hackett [ 13/Aug/14 ] | ||||||||||
|
That can't be right. How can you represent time before the epoch with an unsigned? Also, the spec defines it an int64, not uint64.
| ||||||||||
| Comment by J Rassi [ 13/Aug/14 ] | ||||||||||
|
I believe neither the shell nor the server is misbehaving here. The BSON spec defines the "UTC datetime" type as an unsigned 64-bit integer representing the number of milliseconds since the epoch. Any 64-bit value for this type is valid for storage and retrieval. |