-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: BSON, C Extensions
-
None
-
Major Change
In native.c method: rb_object_id_generator_next, when time is NULL, we use rb_current_time_milliseconds() but this should be
if (argc == 0 || (argc == 1 && *time == Qnil)) { t = htonl(rb_current_time_in_milliseconds()); /* This line needs to be changed. */ else { t = htonl(NUM2UINT(rb_funcall(*time, rb_intern("to_i"), 0))); }
When time is passed, its correctly doing a htonl(). Making this change, ensures that object_ids will be generated in ascending order.