ExportXMLWordPrintableJSON

    • Query Execution
    • Minor Change
    • ALL
    • QE 2026-10-26
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      This issue was found by co-pilot: some equal decimal values can get a different hash.

      Proposed unit test in value_test.cpp to demonstrate it:

       

      TEST(SbeValueHashTest, EqualDecimalsOutsideDoubleRangeHashEqually) {
          using namespace value;
          // 5E-6174 and 500E-6176 are numerically equal, but they have different raw encodings and
          // are too small to be represented as a double, so hashing falls back to the decimal's bits.
          TagValueOwned lhs = TagValueOwned::fromRaw(makeCopyDecimal(Decimal128("5E-6174")));
          TagValueOwned rhs = TagValueOwned::fromRaw(makeCopyDecimal(Decimal128("500E-6176")));
          auto [cmpTag, cmpVal] = compareValue(lhs.tag(), lhs.value(), rhs.tag(), rhs.value());
          ASSERT_EQ(cmpTag, TypeTags::NumberInt32);
          ASSERT_EQ(bitcastTo<int32_t>(cmpVal), 0);
          ASSERT_EQ(hashValue(lhs.tag(), lhs.value()), hashValue(rhs.tag(), rhs.value()));
      }
      

       

            Assignee:
            Justin Seyster
            Reporter:
            Milena Ivanova
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: