Skip to content

Commit 21e3d7c

Browse files
committed
do not create or drop eccCollection
1 parent 8390b32 commit 21e3d7c

File tree

2 files changed

+1
-26
lines changed

2 files changed

+1
-26
lines changed

src/libmongoc/src/mongoc/mongoc-collection.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,10 +1055,8 @@ drop_with_opts_with_encryptedFields (mongoc_collection_t *collection,
10551055
bson_error_t *error)
10561056
{
10571057
char *escName = NULL;
1058-
char *eccName = NULL;
10591058
char *ecocName = NULL;
10601059
mongoc_collection_t *escCollection = NULL;
1061-
mongoc_collection_t *eccCollection = NULL;
10621060
mongoc_collection_t *ecocCollection = NULL;
10631061
bool ok = false;
10641062
const char *name = mongoc_collection_get_name (collection);
@@ -1087,23 +1085,6 @@ drop_with_opts_with_encryptedFields (mongoc_collection_t *collection,
10871085
}
10881086
}
10891087

1090-
/* Drop ECC collection. */
1091-
eccName = _mongoc_get_encryptedField_state_collection (
1092-
encryptedFields, name, "ecc", error);
1093-
if (!eccName) {
1094-
goto fail;
1095-
}
1096-
1097-
eccCollection = mongoc_client_get_collection (
1098-
collection->client, collection->db, eccName);
1099-
if (!drop_with_opts (eccCollection, NULL /* opts */, error)) {
1100-
if (error->code == MONGOC_SERVER_ERR_NS_NOT_FOUND) {
1101-
memset (error, 0, sizeof (bson_error_t));
1102-
} else {
1103-
goto fail;
1104-
}
1105-
}
1106-
11071088
/* Drop ECOC collection. */
11081089
ecocName = _mongoc_get_encryptedField_state_collection (
11091090
encryptedFields, name, "ecoc", error);
@@ -1134,8 +1115,6 @@ drop_with_opts_with_encryptedFields (mongoc_collection_t *collection,
11341115
fail:
11351116
mongoc_collection_destroy (ecocCollection);
11361117
bson_free (ecocName);
1137-
mongoc_collection_destroy (eccCollection);
1138-
bson_free (eccName);
11391118
mongoc_collection_destroy (escCollection);
11401119
bson_free (escName);
11411120
return ok;

src/libmongoc/src/mongoc/mongoc-database.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,15 +1015,13 @@ _mongoc_get_encryptedField_state_collection (
10151015

10161016
if (0 == strcmp (state_collection_suffix, "esc")) {
10171017
fieldName = "escCollection";
1018-
} else if (0 == strcmp (state_collection_suffix, "ecc")) {
1019-
fieldName = "eccCollection";
10201018
} else if (0 == strcmp (state_collection_suffix, "ecoc")) {
10211019
fieldName = "ecocCollection";
10221020
} else {
10231021
bson_set_error (error,
10241022
MONGOC_ERROR_COMMAND,
10251023
MONGOC_ERROR_COMMAND_INVALID_ARG,
1026-
"expected state_collection_suffix to be 'esc', 'ecc', or "
1024+
"expected state_collection_suffix to be 'esc' or "
10271025
"'ecoc', got: %s",
10281026
state_collection_suffix);
10291027
return NULL;
@@ -1100,8 +1098,6 @@ create_collection_with_encryptedFields (mongoc_database_t *database,
11001098
bool state_collections_ok =
11011099
create_encField_state_collection (
11021100
database, encryptedFields, name, "esc", error) &&
1103-
create_encField_state_collection (
1104-
database, encryptedFields, name, "ecc", error) &&
11051101
create_encField_state_collection (
11061102
database, encryptedFields, name, "ecoc", error);
11071103
if (!state_collections_ok) {

0 commit comments

Comments
 (0)