Skip to content

Commit 5e4f128

Browse files
committed
casef and diacf were backwards
1 parent c0353cd commit 5e4f128

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

src/mc-textopts.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,12 @@ static bool TextOpts_to_FLE2TextSearchInsertSpec(const mc_TextOpts_t *txo,
271271
CLIENT_ERR(ERROR_PREFIX "Error appending to BSON");
272272
return false;
273273
}
274-
if (!bson_append_bool(&child, "casef", -1, txo->caseSensitive)) {
274+
if (!bson_append_bool(&child, "casef", -1, !txo->caseSensitive)) {
275275
CLIENT_ERR(ERROR_PREFIX "Error appending to BSON");
276276
return false;
277277
}
278278

279-
if (!bson_append_bool(&child, "diacf", -1, txo->diacriticSensitive)) {
279+
if (!bson_append_bool(&child, "diacf", -1, !txo->diacriticSensitive)) {
280280
CLIENT_ERR(ERROR_PREFIX "Error appending to BSON");
281281
return false;
282282
}

test/test-mc-textopts.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ static void test_mc_TextOpts_to_FLE2TextSearchInsertSpec(_mongocrypt_tester_t *t
163163
}),
164164
.v = RAW_STRING({"v" : "test"}),
165165
.expect = RAW_STRING(
166-
{"v" : {"v" : "test", "casef" : true, "diacf" : false, "substr" : {"mlen" : 10, "ub" : 8, "lb" : 3}}})},
166+
{"v" : {"v" : "test", "casef" : false, "diacf" : true, "substr" : {"mlen" : 10, "ub" : 8, "lb" : 3}}})},
167167
{.desc = "Works with prefix",
168168
.in = RAW_STRING({
169169
"caseSensitive" : true,
@@ -172,7 +172,7 @@ static void test_mc_TextOpts_to_FLE2TextSearchInsertSpec(_mongocrypt_tester_t *t
172172
}),
173173
.v = RAW_STRING({"v" : "test"}),
174174
.expect =
175-
RAW_STRING({"v" : {"v" : "test", "casef" : true, "diacf" : false, "prefix" : {"ub" : 8, "lb" : 3}}})},
175+
RAW_STRING({"v" : {"v" : "test", "casef" : false, "diacf" : true, "prefix" : {"ub" : 8, "lb" : 3}}})},
176176
{.desc = "Works with suffix",
177177
.in = RAW_STRING({
178178
"caseSensitive" : true,
@@ -181,7 +181,7 @@ static void test_mc_TextOpts_to_FLE2TextSearchInsertSpec(_mongocrypt_tester_t *t
181181
}),
182182
.v = RAW_STRING({"v" : "test"}),
183183
.expect =
184-
RAW_STRING({"v" : {"v" : "test", "casef" : true, "diacf" : false, "suffix" : {"ub" : 8, "lb" : 3}}})},
184+
RAW_STRING({"v" : {"v" : "test", "casef" : false, "diacf" : true, "suffix" : {"ub" : 8, "lb" : 3}}})},
185185
{.desc = "Works with prefix + suffix",
186186
.in = RAW_STRING({
187187
"caseSensitive" : true,
@@ -193,8 +193,8 @@ static void test_mc_TextOpts_to_FLE2TextSearchInsertSpec(_mongocrypt_tester_t *t
193193
.expect = RAW_STRING({
194194
"v" : {
195195
"v" : "test",
196-
"casef" : true,
197-
"diacf" : false,
196+
"casef" : false,
197+
"diacf" : true,
198198
"prefix" : {"ub" : 9, "lb" : 4},
199199
"suffix" : {"ub" : 8, "lb" : 3}
200200
}

0 commit comments

Comments
 (0)