TextMatchExpression crashes instead of serializing in some cases

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.0.7, 4.1.9
    • Affects Version/s: None
    • Component/s: Querying
    • Fully Compatible
    • ALL
    • v4.0
    • Hide
      db.test.drop();
      db.test.createIndex({x: "text"});
      db.test.find({ $nor: [{ $text: { $search: 'x' } }]});
      
      Show
      db.test.drop(); db.test.createIndex({x: "text"}); db.test.find({ $nor: [{ $text: { $search: 'x' } }]});
    • Query 2019-03-25
    • 36
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      As part of the fix for https://jira.mongodb.org/browse/SERVER-39019,
      NotMatchExpression::serialize() takes one of two paths when serializing its children. Failure to take the old Nor branch in favor of the new implementation causes TextMatchExpression to hit a MONGO_UNREACHABLE since it inherits from PathMatchExpression.

      We propose either updating TextMatchExpression so it doesn't derive from PathMatchExpression or adding a special case to NotMatchExpression::serialize() for TextMatchExpression children which takes the old Nor branch.

              Assignee:
              James Wahlin
              Reporter:
              Jacob Evans (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: