diff options
author | Erwin Pe <erwin.pe@mongodb.com> | 2023-04-10 17:29:09 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2023-04-10 18:38:29 +0000 |
commit | a6056f1960e1d5e5229b03aa1e4af4a4a745be06 (patch) | |
tree | ad8e2952e68cae4d76f70d482c6ded0fd630c24e /src/mongo/db/commands | |
parent | 24fc1c475061fe39801d67b17e2eb7b35a68cf55 (diff) | |
download | mongo-a6056f1960e1d5e5229b03aa1e4af4a4a745be06.tar.gz |
SERVER-75891 Add optional null anchor positions to getQueryableEncryptionCountInfo reply
Diffstat (limited to 'src/mongo/db/commands')
-rw-r--r-- | src/mongo/db/commands/fle2_get_count_info_command.cpp | 15 | ||||
-rw-r--r-- | src/mongo/db/commands/fle2_get_count_info_command.idl | 38 |
2 files changed, 41 insertions, 12 deletions
diff --git a/src/mongo/db/commands/fle2_get_count_info_command.cpp b/src/mongo/db/commands/fle2_get_count_info_command.cpp index b1dd29fd4dd..55642335564 100644 --- a/src/mongo/db/commands/fle2_get_count_info_command.cpp +++ b/src/mongo/db/commands/fle2_get_count_info_command.cpp @@ -78,12 +78,15 @@ QECountInfoReplyTokens tokenFromCountInfo(const FLEEdgeCountInfo& countInfo) { token.setEDCDerivedFromDataTokenAndContentionFactorToken(countInfo.edc.value().toCDR()); } - if (countInfo.cpos) { - token.setCpos(countInfo.cpos.get()); - } - - if (countInfo.apos) { - token.setApos(countInfo.apos.get()); + if (countInfo.cpos || countInfo.apos) { + ESCOptionalPositionsPair spos; + if (countInfo.cpos) { + spos.setCpos(countInfo.cpos.get()); + } + if (countInfo.apos) { + spos.setApos(countInfo.apos.get()); + } + token.setSearchedPositions(spos); } if (countInfo.stats) { diff --git a/src/mongo/db/commands/fle2_get_count_info_command.idl b/src/mongo/db/commands/fle2_get_count_info_command.idl index 8717fa9e32f..0914ee9f5cc 100644 --- a/src/mongo/db/commands/fle2_get_count_info_command.idl +++ b/src/mongo/db/commands/fle2_get_count_info_command.idl @@ -34,6 +34,30 @@ imports: - "mongo/crypto/fle_stats.idl" structs: + ESCPositionsPair: + description: "A pair of non-anchor and anchor positions" + strict: true + fields: + cpos: + description: "non-anchor position" + type: long + apos: + description: "anchor position" + type: long + + ESCOptionalPositionsPair: + description: "A pair of optional non-anchor and anchor positions" + strict: true + fields: + cpos: + description: "non-anchor position" + type: long + optional: true + apos: + description: "anchor position" + type: long + optional: true + QECountInfoReplyTokens: description: "A tokens of ESC information" strict: true @@ -51,13 +75,15 @@ structs: type: bindata_generic cpp_name: EDCDerivedFromDataTokenAndContentionFactorToken optional: true - cpos: - description: "cpos argument returned from emuBinary" - type: long + spos: + description: "positions returned from emuBinary" + type: ESCOptionalPositionsPair + cpp_name: SearchedPositions optional: true - apos: - description: "cpos argument returned from emuBinary" - type: long + npos: + description: "position pair retrieved from the null anchor" + type: ESCPositionsPair + cpp_name: NullAnchorPositions optional: true stats: description: "stats returned for compaction algorithm" |