[SERVER-44929] Assert Location51156 faired in $regexMatch Created: 03/Dec/19  Updated: 03/Dec/19  Resolved: 03/Dec/19

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: 4.2.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: N L Assignee: Danny Hatcher (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-44617 $regexFind crash when one of the capt... Closed
Operating System: ALL
Steps To Reproduce:
  1. Create a collection named "a" with the following one single document:

{ "_id" : ObjectId("5de69716abd1d74e8cb2a026"), // no matter  "fld" : "c!" }

 

2. Run the following aggregation query:

db.getCollection("a").aggregate(
 [
 { 
 "$match" : {
 "$expr" : {
 "$regexMatch" :
 
{ "input" : "$fld", "regex" : "^c(a|b)?!$" }
 
}
 }
 }
 ]
 );
  

Expected result: one document found

Actual result: error

{ "ok" : 0.0, "errmsg" : "Error occurred while executing the regular expression in $regexMatch. Result code: 1", "code" : NumberInt(51156), "codeName" : "Location51156" }

 

Participants:

 Description   

The assert in https://github.com/mongodb/mongo/blob/master/src/mongo/db/pipeline/expression.cpp fires at line starting from "uassert(51156"

The comment to the code mentions "The latter scenario should never occur" but it does

 

 

 



 Comments   
Comment by Danny Hatcher (Inactive) [ 03/Dec/19 ]

Thanks for the bug report. We've noticed the problem and resolved it in SERVER-44617. When 4.2.2 is released please download that version and the command should work.

I'm going to close this ticket as a duplicate as the other ticket contains the fix.

Generated at Thu Feb 08 05:07:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.