[SERVER-82407] setIsSubset semantics differ in Classic and SBE Created: 24/Oct/23  Updated: 26/Oct/23  Resolved: 26/Oct/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.2.0-rc0

Type: Bug Priority: Major - P3
Reporter: Foteini Alvanaki Assignee: Foteini Alvanaki
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Cloners
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

Create the collection

db.testCol.insertOne({_id:1})

 

Query the collection in SBE and in Classic

db.testCol.aggregate([ { $project: { "isSubset":
{ $setIsSubset: [ "$array",[]] }
} }])

 

SBE returns

[ { _id: 1, isSubset: null } ]

while classic returns

MongoServerError: PlanExecutor error during aggregation :: caused by :: both operands of $setIsSubset must be arrays. First argument is of type: missing

Sprint: QE 2023-10-30
Participants:
Linked BF Score: 125

 Description   

setIsSubset expects two arrays as inputs. Classic throws an error if one of the arrays is missing. SBE checks the types before calling setIsSubset and returns null if one of them is missing. This different is causing a failure in fuzzer tests.



 Comments   
Comment by Foteini Alvanaki [ 25/Oct/23 ]

Code review:
TIG-4519 Relax fuzzer to accommodate the difference in semantics b... 

https://github.com/10gen/jstestfuzz/pull/872
Base branch: master

Generated at Thu Feb 08 06:49:08 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.