[SERVER-67624] [CQF] Fix ABT translations for match expressions against MinKey and MaxKey Created: 28/Jun/22  Updated: 29/Oct/23  Resolved: 02/Aug/22

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

Type: Bug Priority: Major - P3
Reporter: Emily Wang (Inactive) Assignee: Ben Shteinfeld
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
backported by SERVER-67782 Fix handling of bounds with MaxKey an... Closed
Depends
depends on SERVER-68310 [CQF] {a: {$gte: MinKey()}} hits asse... Closed
Related
related to SERVER-68100 Complete TODO listed in SERVER-67624 Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

Current ABTs fail to match {a: []} when doing db.find({a: {$lte: MaxKey()}). The desired behavior of db.find({a: {$lte: MaxKey()}) should return any and all document, with the field 'a'.

The suspect issue arises when we choose to traverse the array and make a compare between each element and MaxKey() .

Instead, the array itself should be compared to MaxKey(), as an empty array satisfies the $lte: MaxKey() requirement. Similar behavior should also be implemented when comparing to MinKey().



 Comments   
Comment by Hana Pearlman [ 18/Jul/22 ]

Reopening to do a bit of investigation. Let's see if it makes sense to make changes to translation (mirroring SBE stage builders) and, if so, how these changes interact with the changes in SERVER-67782.

Comment by Ben Shteinfeld [ 15/Jul/22 ]

SERVER-67782 addresses this bug in the lowering code, removing the need to implement this in the translation to ABT.

Comment by Hana Pearlman [ 30/Jun/22 ]

emily.wang@mongodb.com Looks like there's something wrong with the link on "we choose to traverse...". Can you update that link?

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