[SERVER-39771] TextMatchExpression crashes instead of serializing in some cases Created: 22/Feb/19  Updated: 29/Oct/23  Resolved: 14/Mar/19

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 4.0.7, 4.1.9

Type: Bug Priority: Major - P3
Reporter: Jacob Evans Assignee: James Wahlin
Resolution: Fixed Votes: 0
Labels: afz
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
related to SERVER-40135 TextMatchExpressionBase should not de... Backlog
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.0
Steps To Reproduce:

db.test.drop();
db.test.createIndex({x: "text"});
db.test.find({ $nor: [{ $text: { $search: 'x' } }]});

Sprint: Query 2019-03-25
Participants:
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.



 Comments   
Comment by Githook User [ 08/Mar/19 ]

Author:

{'name': 'James Wahlin', 'email': 'james@mongodb.com', 'username': 'jameswahlin'}

Message: SERVER-39771 TextMatchExpression crashes instead of serializing in some cases

(cherry picked from commit 8a9a6071b9aac873689cd777dfb4ed6bbad74e04)
Branch: v4.0
https://github.com/mongodb/mongo/commit/023d3450d39c62a3cc70f6cdc4a52a7f486aeb37

Comment by Githook User [ 08/Mar/19 ]

Author:

{'name': 'James Wahlin', 'email': 'james@mongodb.com', 'username': 'jameswahlin'}

Message: SERVER-39771 TextMatchExpression crashes instead of serializing in some cases
Branch: master
https://github.com/mongodb/mongo/commit/8a9a6071b9aac873689cd777dfb4ed6bbad74e04

Generated at Thu Feb 08 04:53:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.