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

TextMatchExpression crashes instead of serializing in some cases

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0.7, 4.1.9
    • Component/s: Querying
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v4.0
    • Steps To Reproduce:
      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' } }]});
    • Sprint:
      Query 2019-03-25
    • Linked BF Score:
      36

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: