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

Assert Location51156 faired in $regexMatch

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.2.1
    • Component/s: Aggregation Framework
    • None
    • ALL
    • 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" }  

      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

       

       

       

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

              Created:
              Updated:
              Resolved: