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

[sbe][query_fuzzer_standalone] SBE regex expression does not accept regex arguments

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • ALL
    • Query Execution 2021-05-17

      In this task, note that the argument to $regexFind is a regex literal:

      [js_test:query_fuzzer-2eaf33-1619674619344-0] Unexpected failure for command: {
      [js_test:query_fuzzer-2eaf33-1619674619344-0] 	"find" : "fuzzer_coll",
      [js_test:query_fuzzer-2eaf33-1619674619344-0] 	"filter" : {
      [js_test:query_fuzzer-2eaf33-1619674619344-0] 		"$expr" : {
      [js_test:query_fuzzer-2eaf33-1619674619344-0] 			"$regexFind" : {
      [js_test:query_fuzzer-2eaf33-1619674619344-0] 				"input" : "$obj.obj.obj.str",
      [js_test:query_fuzzer-2eaf33-1619674619344-0] 				"regex" : /^(?:Rustic Plastic Keyboar|fee)d|bluetooth/
      [js_test:query_fuzzer-2eaf33-1619674619344-0] 			}
      [js_test:query_fuzzer-2eaf33-1619674619344-0] 		}
      [js_test:query_fuzzer-2eaf33-1619674619344-0] 	},
      [js_test:query_fuzzer-2eaf33-1619674619344-0] 	"sort" : {
      [js_test:query_fuzzer-2eaf33-1619674619344-0] 		"array" : 1,
      [js_test:query_fuzzer-2eaf33-1619674619344-0] 		"_id" : 1
      [js_test:query_fuzzer-2eaf33-1619674619344-0] 	},
      [js_test:query_fuzzer-2eaf33-1619674619344-0] 	"limit" : NumberInt(13),
      [js_test:query_fuzzer-2eaf33-1619674619344-0] 	"projection" : {
      [js_test:query_fuzzer-2eaf33-1619674619344-0] 		"sortKey" : {
      [js_test:query_fuzzer-2eaf33-1619674619344-0] 			"$meta" : "sortKey"
      [js_test:query_fuzzer-2eaf33-1619674619344-0] 		}
      [js_test:query_fuzzer-2eaf33-1619674619344-0] 	}
      [js_test:query_fuzzer-2eaf33-1619674619344-0] }
      [js_test:query_fuzzer-2eaf33-1619674619344-0] uncaught exception: Error: Find and aggregate commands failed with different errors: [null] != [Error: error: {
      [js_test:query_fuzzer-2eaf33-1619674619344-0] 	"ok" : 0,
      [js_test:query_fuzzer-2eaf33-1619674619344-0] 	"errmsg" : "PlanExecutor error during aggregation :: caused by :: $regexFind: input must be of type string",
      [js_test:query_fuzzer-2eaf33-1619674619344-0] 	"code" : 5073401,
      [js_test:query_fuzzer-2eaf33-1619674619344-0] 	"codeName" : "Location5073401"
      [js_test:query_fuzzer-2eaf33-1619674619344-0] }] :
      

      The exact uassert being tripped is here: https://github.com/mongodb/mongo/blob/7fe73c9955e44c7e99c5c3487454bb2ad64740e1/src/mongo/db/query/sbe_stage_builder_expression.cpp#L3337-L3338

            Assignee:
            martin.neupauer@mongodb.com Martin Neupauer
            Reporter:
            kyle.suarez@mongodb.com Kyle Suarez
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: