Uploaded image for project: 'Ruby Driver'
  1. Ruby Driver
  2. RUBY-2063

BSON timestamp components are decoded as 32-bit signed integers

    • Timestamp components are now decoded as unsigned integers as per the BSON specification. Previously components were erroneously decoded as signed integers.
    • Minor Change

      Should be decoded as 32-bit unsigned integers:

        1) BSON Corpus spec tests (timestamp.json): Timestamp type VALID CASE: Timestamp with high-order bit set on both seconds and increment converts bson to relaxed extended json
           Failure/Error: JSON.parse(decoded_canonical_bson.to_json).should == (test.relaxed_extjson_doc || test.canonical_extjson_doc)
           
             expected: {"a"=>{"$timestamp"=>{"i"=>4294967295, "t"=>4294967295}}}
                  got: {"a"=>{"$timestamp"=>{"i"=>-1, "t"=>-1}}} (using ==)
             Diff:
             @@ -1,2 +1,2 @@
             -"a" => {"$timestamp"=>{"i"=>4294967295, "t"=>4294967295}},
             +"a" => {"$timestamp"=>{"i"=>-1, "t"=>-1}},
             
           # ./spec/spec_tests/corpus_spec.rb:39:in `block (6 levels) in <top (required)>'
      
       6/6 |======================================== 100 ========================================>| Time: 00:00:00 
      
      Finished in 0.04077 seconds (files took 0.26375 seconds to load)
      6 examples, 1 failure
      
      Failed examples:
      
      rspec './spec/spec_tests/corpus_spec.rb[1:14:3:2]' # BSON Corpus spec tests (timestamp.json): Timestamp type VALID CASE: Timestamp with high-order bit set on both seconds and increment converts bson to relaxed extended json
      

            Assignee:
            neil.shweky@mongodb.com Neil Shweky (Inactive)
            Reporter:
            oleg.pudeyev@mongodb.com Oleg Pudeyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: