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

Assert Location51156 faired in $regexMatch

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: 4.2.1
    • Fix Version/s: None
    • Component/s: Aggregation Framework
    • Labels:
      None
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide
      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" }

       

      Show
      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" }  

      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

       

       

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              daniel.hatcher Daniel Hatcher (Inactive)
              Reporter:
              nlast@yandex.ru N L
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: