Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-14662

Investigate changes in SERVER-57321: $mod match expression incorrectly handles NaN, Infinity and large values

      Downstream Change Summary

      $mod match expression semantics was changed to:
      (1) for dividend parameter - to not match a document if dividend value is either NaN or Infinity; to throw an exception if the rounded dividend value cannot be represented as a 64-bit integer;
      (2) for divisor, remainder parameters - to throw an exception if value is either NaN or Infinity, or the rounded value cannot be represented as a 64-bit integer.

      Description of Linked Ticket

      In classic variant of query execution $mod match expression (ModMatchExpression) interprets dividend value NaN (double) as -9223372036854775808 64-bit integer. In SBE, on the other hand, NaN to 64-bit integer transformation results in Nothing.  Furthermore, NumberDecimal("9.999999999999999999999999999999999E+6144") gets interpreted as NumberLong("-9223372036854775808") (classic and SBE). Those two factors, when combined, give unexpected results.  Please see "Steps to Reproduce".

       

            Assignee:
            jason.price@mongodb.com Jason Price
            Reporter:
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              2 years, 23 weeks, 2 days ago