Nim icon indicating copy to clipboard operation
Nim copied to clipboard

fixes #20285; prevent oid time overflow at year 2038

Open ringabout opened this issue 1 year ago • 5 comments

fixes #20285 ref https://github.com/py-bson/bson/pull/117

ringabout avatar Sep 12 '22 12:09 ringabout

I reproduce the issue by setting the date on my computer to year 2038.

ringabout avatar Sep 12 '22 15:09 ringabout

Is it possible to add a test for this?

Varriount avatar Sep 12 '22 17:09 Varriount

I guess not too easy, at least we probably can get one at openSUSE :)

ringabout avatar Sep 15 '22 15:09 ringabout

Can we use the date command to test it?

edit: lol, the last commit says it was made on Sep 12, 2038

metagn avatar Sep 17 '22 10:09 metagn

I'm ok with either:

  • Matching whatever behavior MongoDB exhibits (as long as the behavior isn't "raise an exception")
  • Increasing the underlying integer size to 64 bits.

Varriount avatar Sep 21 '22 19:09 Varriount

I say, please increase the underlying integer size to 64 bits.

Araq avatar Sep 21 '22 21:09 Araq

Sure

ringabout avatar Sep 22 '22 05:09 ringabout

Once again, I set the system date to 2038 and there is no problem.

ringabout avatar Sep 22 '22 12:09 ringabout

Thanks for your hard work on this PR! The lines below are statistics of the Nim compiler built from db8a62d4802a005b80aa07ca355ddee4bf098b11

Hint: mm: orc; threads: on; opt: speed; options: -d:release 164054 lines; 12.595s; 842.328MiB peakmem

github-actions[bot] avatar Sep 22 '22 13:09 github-actions[bot]