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

Add special handling of NaN for whether query can be answered by a partial index

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.1.3
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • Fully Compatible

      Should match the special handling for NaN values that ComparisonMatchExpression::matchesSingleElement() does:

      // Special case handling for NaN. NaN is equal to NaN but
      // otherwise always compares to false.
      if (std::isnan(e.numberDouble()) || std::isnan(_rhs.numberDouble())) {
          bool bothNaN = std::isnan(e.numberDouble()) && std::isnan(_rhs.numberDouble());
          switch ( matchType() ) {
          case LT:
              return false;
          case LTE:
              return bothNaN;
          case EQ:
              return bothNaN;
          case GT:
              return false;
          case GTE:
              return bothNaN;
          default:
              // This is a comparison match expression, so it must be either
              // a $lt, $lte, $gt, $gte, or equality expression.
              fassertFailed( 17448 );
          }
      }
      

            Assignee:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Reporter:
            max.hirschhorn@mongodb.com Max Hirschhorn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: