Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-31775

NaN comparison not aligned between query and pipeline

    • Query Optimization

      The query comparison operators have a handled case for NaN

      This behavior is not aligned with the Comparison Aggregation Operators and provides different result when used i.e. in $match pipeline stage or in a $project stage.

      Query : src/mongo/db/matcher/expression_leaf.cpp

      // Special case handling for NaN. NaN is equal to NaN but
      // otherwise always compares to false.
      

      Pipeline: src/mongo/db/pipeline/value.cpp

      return compareInts(rL._storage.intValue, rR._storage.intValue);
      

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            Uyttendaele Simon
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated: