[SERVER-70316] Minimum bounds on dates in open range conjunction queries is set incorrectly Created: 06/Oct/22  Updated: 29/Oct/23  Resolved: 19/Oct/22

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

Type: Bug Priority: Major - P3
Reporter: Gil Alon Assignee: Davis Haupt (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: QO 2022-10-31
Participants:

 Description   

The following queries fail with fle2 because the start of the interval is using the minimum date instead of using double infinity.

 $and: [{birthdate: {$lt: ISODate("2002-12-04T10:45:10.957Z")}}, {debt: {$lte: NumberDecimal(5000.00)}}] 

{birthdate: {$not: {$lt: ISODate("2002-12-04T10:45:10.957Z")}}} 

Therefore, this uassert statement in query_analysis fails. since the lower bound of the query is the minimum date, which can be out of bounds of the range index. 

uassert(6747901, 
str::stream() 
<< "Lower bound of range predicate must be within the bounds of encrypted index.",            
elementIsInfinite(interval.start) ||  literalWithinRangeBounds(metadata, interval.start)); 



 Comments   
Comment by Githook User [ 19/Oct/22 ]

Author:

{'name': 'Davis Haupt', 'email': 'davis.haupt@mongodb.com', 'username': 'davish'}

Message: SERVER-70316 fix one-sided date range inside $and
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/b2ea81ef1066b7b70699d102190651e1afae2470

Comment by Davis Haupt (Inactive) [ 18/Oct/22 ]

A date is not a numeric type, and so the index bounds builder will use a date rather than +/-inf for type bracketing purposes. We should make sure when constructing a between from an interval that the types match appropriately in this case.

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