Operational Defect Database

BugZero found this defect 44 days ago.

MongoDB | 2633811

Support $let commands in setQuerySettings

Last update date:

4/5/2024

Affected products:

MongoDB Server

Affected releases:

No affected releases provided.

Fixed releases:

8.0 Required

Description:

Info

It was discovered as part of the newly introduced `implicit_query_settings_fallback` that trying to set query settings over commands involving variables fails with a "Use of undefined variable: " error. This happens when generating the query shape hash, and it's most probably due to how the blank expression context is constructed. Example error: Parsley Logs] uncaught exception: Error: command failed: { "ok" : 0, "errmsg" : "Invalid $addFields :: caused by :: Use of undefined variable: variable", "code" : 17276, "codeName" : "Location17276", "$clusterTime" : { "clusterTime" : Timestamp(1712334639, 18), "signature" : { "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="), "keyId" : NumberLong(0) } }, "operationTime" : Timestamp(1712334639, 18)  } with original command request: { "setQuerySettings" : { "aggregate" : "command_let_variables", "$db" : "test", "cursor" : { }, "pipeline" : [ { "$merge" : { "into" : "command_let_variables_target", "whenMatched" : [ { "$addFields" : { "var" : "$$variable" } } ] } } ], "let" : { "variable" : "OUTER" }, "lsid" : { "id" : UUID("70376fd6-a2da-4d01-a7e9-a0780b412de9") }, "$clusterTime" : { "clusterTime" : Timestamp(1712334639, 18), "signature" : { "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="), "keyId" : NumberLong(0) } } }, "settings" : { "indexHints" : { "ns" : { "db" : "test", "coll" : "command_let_variables" }, "allowedIndexes" : [ "doesnotexist" ] } }, "lsid" : { "id" : UUID("70376fd6-a2da-4d01-a7e9-a0780b412de9") }, "$clusterTime" : { "clusterTime" : Timestamp(1712334639, 18), "signature" : { "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="), "keyId" : NumberLong(0) } }  } on connection: connection to localhost:20000 :

Top User Comments


Steps to Reproduce


Additional Resources / Links

Share:

BugZero® Risk Score

What's this?

Coming soon

Status

Needs Scheduling

Learn More

Search:

...