[SERVER-50762] [SBE] SizeMatchExpression can produce wrong results in some cases involving nesting Created: 03/Sep/20  Updated: 29/Oct/23  Resolved: 12/Nov/20

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Bug Priority: Major - P3
Reporter: Drew Paroski Assignee: Melodee Li
Resolution: Fixed Votes: 0
Labels: qexec-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

> db.coll.insert({a: 1, b: "foo"})
> db.coll.insert({a: 1, b: [7,8,9]})
> db.coll.find({}, {_id: 0})
{ "a" : 1, "b" : "foo" }
{ "a" : 1, "b" : [ 7, 8, 9 ] }

> db.adminCommand({setParameter:1, internalQueryEnableSlotBasedExecutionEngine:false})
> db.coll.find({$or: [{$and: [{b: {$size: 3}}, {a: 1}]}, {a: 0}]}, {_id: 0})
{ "a" : 1, "b" : [ 7, 8, 9 ] }

> db.adminCommand({setParameter:1, internalQueryEnableSlotBasedExecutionEngine:true})
> db.coll.find({$or: [{$and: [{b: {$size: 3}}, {a: 1}]}, {a: 0}]}, {_id: 0})
{ "a" : 1, "b" : "foo" }
{ "a" : 1, "b" : [ 7, 8, 9 ] }

Sprint: Query 2020-11-16
Participants:

 Description   

See the "Steps to Reproduce" section for an example where using the $size operator in the find() command can produce incorrect results when SBE mode is enabled.



 Comments   
Comment by Githook User [ 16/Nov/20 ]

Author:

{'name': 'Melodee Li', 'email': 'melodeeli98@gmail.com', 'username': 'melodeeli98'}

Message: SERVER-52844 Back out changes to find_size.js made by SERVER-50762
Branch: master
https://github.com/mongodb/mongo/commit/d1ba7acc9258186e0b70e3e1be45b67de098bb58

Comment by Githook User [ 13/Nov/20 ]

Author:

{'name': 'Drew Paroski', 'email': 'drew.paroski@mongodb.com', 'username': 'paroski'}

Message: SERVER-52844 Back out changes to "find_size.js" made by SERVER-50762
Branch: master
https://github.com/mongodb/mongo/commit/6dc4a4eaf4acc7472590040fa5795901b5140fc5

Comment by Githook User [ 12/Nov/20 ]

Author:

{'name': 'Melodee Li', 'email': 'melodeeli98@gmail.com', 'username': 'melodeeli98'}

Message: SERVER-50762 [SBE] SizeMatchExpression can produce wrong results in some cases involving nesting
Branch: master
https://github.com/mongodb/mongo/commit/ac9d73de226e40aaa16f5e8c4c44536d49631e49

Comment by Githook User [ 12/Nov/20 ]

Author:

{'name': 'Uladzimir Makouski', 'email': 'uladzimir.makouski@mongodb.com', 'username': 'umakouski'}

Message: Revert "SERVER-50762 [SBE] SizeMatchExpression can produce wrong results in some cases involving nesting"

This reverts commit 21b2bc7ecb9b16d1043b2a6fe845127637ea3467.
Branch: master
https://github.com/mongodb/mongo/commit/568397c0383db46a50d556ca6f877aeea9fda132

Comment by Githook User [ 09/Nov/20 ]

Author:

{'name': 'Melodee Li', 'email': 'melodeeli98@gmail.com', 'username': 'melodeeli98'}

Message: SERVER-50762 [SBE] SizeMatchExpression can produce wrong results in some cases involving nesting
Branch: master
https://github.com/mongodb/mongo/commit/21b2bc7ecb9b16d1043b2a6fe845127637ea3467

Generated at Thu Feb 08 05:23:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.