Skip to content

Commit 2c95f9c

Browse files
committed
CDRIVER-1462 remove mongoc_collection_create_index_2 from 1.4
This reverts commit dc9fd22. # Conflicts: # tests/test-mongoc-collection.c
1 parent 7f75616 commit 2c95f9c

10 files changed

+50
-226
lines changed

build/autotools/versions.ldscript

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ LIBMONGOC_1.0 {
4848
mongoc_collection_count;
4949
mongoc_collection_create_bulk_operation;
5050
mongoc_collection_create_index;
51-
mongoc_collection_create_index_2;
5251
mongoc_collection_delete;
5352
mongoc_collection_destroy;
5453
mongoc_collection_drop;

build/cmake/libmongoc-experimental.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ mongoc_collection_count
9898
mongoc_collection_count_with_opts
9999
mongoc_collection_create_bulk_operation
100100
mongoc_collection_create_index
101-
mongoc_collection_create_index_2
102101
mongoc_collection_delete
103102
mongoc_collection_destroy
104103
mongoc_collection_drop

build/cmake/libmongoc-ssl-experimental.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ mongoc_collection_count
100100
mongoc_collection_count_with_opts
101101
mongoc_collection_create_bulk_operation
102102
mongoc_collection_create_index
103-
mongoc_collection_create_index_2
104103
mongoc_collection_delete
105104
mongoc_collection_destroy
106105
mongoc_collection_drop

build/cmake/libmongoc-ssl.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ mongoc_collection_count
9797
mongoc_collection_count_with_opts
9898
mongoc_collection_create_bulk_operation
9999
mongoc_collection_create_index
100-
mongoc_collection_create_index_2
101100
mongoc_collection_delete
102101
mongoc_collection_destroy
103102
mongoc_collection_drop

build/cmake/libmongoc.def

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ mongoc_collection_count
9595
mongoc_collection_count_with_opts
9696
mongoc_collection_create_bulk_operation
9797
mongoc_collection_create_index
98-
mongoc_collection_create_index_2
9998
mongoc_collection_delete
10099
mongoc_collection_destroy
101100
mongoc_collection_drop

doc/mongoc_collection_create_index_2.page

Lines changed: 0 additions & 55 deletions
This file was deleted.

src/libmongoc.symbols

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ mongoc_collection_count
102102
mongoc_collection_count_with_opts
103103
mongoc_collection_create_bulk_operation
104104
mongoc_collection_create_index
105-
mongoc_collection_create_index_2
106105
mongoc_collection_delete
107106
mongoc_collection_destroy
108107
mongoc_collection_drop

src/mongoc/mongoc-collection.c

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -982,23 +982,6 @@ mongoc_collection_create_index (mongoc_collection_t *collection,
982982
const bson_t *keys,
983983
const mongoc_index_opt_t *opt,
984984
bson_error_t *error)
985-
{
986-
bson_t reply;
987-
bool ret;
988-
989-
ret = mongoc_collection_create_index_2 (collection, keys, opt,
990-
&reply, error);
991-
992-
bson_destroy (&reply);
993-
return ret;
994-
}
995-
996-
bool
997-
mongoc_collection_create_index_2 (mongoc_collection_t *collection,
998-
const bson_t *keys,
999-
const mongoc_index_opt_t *opt,
1000-
bson_t *reply,
1001-
bson_error_t *error)
1002985
{
1003986
const mongoc_index_opt_t *def_opt;
1004987
const mongoc_index_opt_geo_t *def_geo;
@@ -1007,16 +990,14 @@ mongoc_collection_create_index_2 (mongoc_collection_t *collection,
1007990
bson_t cmd = BSON_INITIALIZER;
1008991
bson_t ar;
1009992
bson_t doc;
993+
bson_t reply;
1010994
bson_t storage_doc;
1011995
bson_t wt_doc;
1012996
const mongoc_index_opt_geo_t *geo_opt;
1013997
const mongoc_index_opt_storage_t *storage_opt;
1014998
const mongoc_index_opt_wt_t *wt_opt;
1015999
char *alloc_name = NULL;
10161000
bool ret = false;
1017-
bool reply_initialized = false;
1018-
1019-
ENTRY;
10201001

10211002
BSON_ASSERT (collection);
10221003
BSON_ASSERT (keys);
@@ -1039,7 +1020,7 @@ mongoc_collection_create_index_2 (mongoc_collection_t *collection,
10391020
"Cannot generate index name from invalid `keys` argument"
10401021
);
10411022
bson_destroy (&cmd);
1042-
GOTO (done);
1023+
return false;
10431024
}
10441025
}
10451026

@@ -1120,9 +1101,8 @@ mongoc_collection_create_index_2 (mongoc_collection_t *collection,
11201101
bson_append_document_end (&ar, &doc);
11211102
bson_append_array_end (&cmd, &ar);
11221103

1123-
ret = mongoc_collection_command_simple (collection, &cmd, NULL, reply,
1104+
ret = mongoc_collection_command_simple (collection, &cmd, NULL, &reply,
11241105
&local_error);
1125-
reply_initialized = true;
11261106

11271107
/*
11281108
* If we failed due to the command not being found, then use the legacy
@@ -1132,24 +1112,16 @@ mongoc_collection_create_index_2 (mongoc_collection_t *collection,
11321112
if (local_error.code == MONGOC_ERROR_QUERY_COMMAND_NOT_FOUND) {
11331113
ret = _mongoc_collection_create_index_legacy (collection, keys, opt,
11341114
error);
1135-
/* Clear the error reply from the first request */
1136-
if (reply) {
1137-
bson_reinit (reply);
1138-
}
11391115
} else if (error) {
11401116
memcpy (error, &local_error, sizeof *error);
11411117
}
11421118
}
11431119

11441120
bson_destroy (&cmd);
1121+
bson_destroy (&reply);
11451122
bson_free (alloc_name);
11461123

1147-
done:
1148-
if (!reply_initialized && reply) {
1149-
bson_init (reply);
1150-
}
1151-
1152-
RETURN (ret);
1124+
return ret;
11531125
}
11541126

11551127

src/mongoc/mongoc-collection.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,6 @@ bool mongoc_collection_create_index (mongoc_col
8989
const bson_t *keys,
9090
const mongoc_index_opt_t *opt,
9191
bson_error_t *error);
92-
bool mongoc_collection_create_index_2 (mongoc_collection_t *collection,
93-
const bson_t *keys,
94-
const mongoc_index_opt_t *opt,
95-
bson_t *reply,
96-
bson_error_t *error);
9792
bool mongoc_collection_ensure_index (mongoc_collection_t *collection,
9893
const bson_t *keys,
9994
const mongoc_index_opt_t *opt,

0 commit comments

Comments
 (0)