MCPcopy Create free account
hub / github.com/documentdb/documentdb / MakeUpperBoundIdExpr

Function MakeUpperBoundIdExpr

pg_documentdb/src/query/query_operator.c:3931–3950  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3929
3930
3931Expr *
3932MakeUpperBoundIdExpr(const bson_value_t *filterValue, Index collectionVarno)
3933{
3934 /* Since btree doesn't do type bracketing - apply type bracketing here */
3935 bool isUpperBoundInclusive = false;
3936 bson_value_t maxBound = { 0 };
3937 if (filterValue->value_type == BSON_TYPE_MINKEY)
3938 {
3939 isUpperBoundInclusive = true;
3940 maxBound.value_type = BSON_TYPE_MAXKEY;
3941 }
3942 else
3943 {
3944 maxBound = GetUpperBound(filterValue->value_type,
3945 &isUpperBoundInclusive);
3946 }
3947 return MakeSimpleIdExpr(&maxBound, collectionVarno,
3948 isUpperBoundInclusive ?
3949 BsonLessThanEqualOperatorId() : BsonLessThanOperatorId());
3950}
3951
3952
3953/*

Callers 2

CheckAndAddIdFilterFunction · 0.85

Calls 4

GetUpperBoundFunction · 0.85
MakeSimpleIdExprFunction · 0.85
BsonLessThanOperatorIdFunction · 0.85

Tested by

no test coverage detected