Skip to content

Commit 9bbc314

Browse files
committed
CDRIVER-1551 use BAD_WIRE_VERSION for collation errs
1 parent 8dbce23 commit 9bbc314

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

src/mongoc/mongoc-client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1292,7 +1292,7 @@ _mongoc_client_command_append_iterator_opts_to_command (bson_iter_t *iter,
12921292
if (max_wire_version < WIRE_VERSION_COLLATION) {
12931293
bson_set_error (error,
12941294
MONGOC_ERROR_COMMAND,
1295-
MONGOC_ERROR_COMMAND_INVALID_ARG,
1295+
MONGOC_ERROR_PROTOCOL_BAD_WIRE_VERSION,
12961296
"The selected server does not support collation");
12971297
RETURN (false);
12981298
}

src/mongoc/mongoc-collection.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,7 @@ mongoc_collection_create_index_with_opts (
12941294
if (has_collation && server_stream->sd->max_wire_version < WIRE_VERSION_COLLATION) {
12951295
bson_set_error (error,
12961296
MONGOC_ERROR_COMMAND,
1297-
MONGOC_ERROR_COMMAND_INVALID_ARG,
1297+
MONGOC_ERROR_PROTOCOL_BAD_WIRE_VERSION,
12981298
"The selected server does not support collation");
12991299
GOTO (done);
13001300
}
@@ -1317,7 +1317,7 @@ mongoc_collection_create_index_with_opts (
13171317
if (has_collation) {
13181318
bson_set_error (error,
13191319
MONGOC_ERROR_COMMAND,
1320-
MONGOC_ERROR_COMMAND_INVALID_ARG,
1320+
MONGOC_ERROR_PROTOCOL_BAD_WIRE_VERSION,
13211321
"The selected server does not support collation");
13221322
}
13231323
ret = _mongoc_collection_create_index_legacy (collection, keys, opt,

src/mongoc/mongoc-write-command.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1275,7 +1275,7 @@ _mongoc_write_command(mongoc_write_command_t *command,
12751275
server_stream->sd->max_wire_version < WIRE_VERSION_COLLATION) {
12761276
bson_set_error (error,
12771277
MONGOC_ERROR_COMMAND,
1278-
MONGOC_ERROR_COMMAND_INVALID_ARG,
1278+
MONGOC_ERROR_PROTOCOL_BAD_WIRE_VERSION,
12791279
"Collation is not supported by the selected server");
12801280
EXIT;
12811281
}

tests/test-bulk.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3160,7 +3160,7 @@ _test_bulk_collation (int w, int wire_version, bulkop op)
31603160
if (w) {
31613161
ASSERT_ERROR_CONTAINS(error,
31623162
MONGOC_ERROR_COMMAND,
3163-
MONGOC_ERROR_COMMAND_INVALID_ARG,
3163+
MONGOC_ERROR_PROTOCOL_BAD_WIRE_VERSION,
31643164
"Collation is not supported by the selected server");
31653165
} else {
31663166
ASSERT_ERROR_CONTAINS(error,
@@ -3236,7 +3236,7 @@ _test_bulk_collation_multi (int w, int wire_version)
32363236
if (w) {
32373237
ASSERT_ERROR_CONTAINS(error,
32383238
MONGOC_ERROR_COMMAND,
3239-
MONGOC_ERROR_COMMAND_INVALID_ARG,
3239+
MONGOC_ERROR_PROTOCOL_BAD_WIRE_VERSION,
32403240
"Collation is not supported by the selected server");
32413241
} else {
32423242
ASSERT_ERROR_CONTAINS(error,

tests/test-mongoc-collection.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4246,7 +4246,7 @@ test_aggregate_with_collation (int wire)
42464246
ASSERT (mongoc_cursor_error (cursor, &error));
42474247
ASSERT_ERROR_CONTAINS (error,
42484248
MONGOC_ERROR_COMMAND,
4249-
MONGOC_ERROR_COMMAND_INVALID_ARG,
4249+
MONGOC_ERROR_PROTOCOL_BAD_WIRE_VERSION,
42504250
"The selected server does not support collation");
42514251
}
42524252

@@ -4327,7 +4327,7 @@ test_index_with_collation (int wire)
43274327
ASSERT (!future_get_bool (future));
43284328
ASSERT_ERROR_CONTAINS (error,
43294329
MONGOC_ERROR_COMMAND,
4330-
MONGOC_ERROR_COMMAND_INVALID_ARG,
4330+
MONGOC_ERROR_PROTOCOL_BAD_WIRE_VERSION,
43314331
"The selected server does not support collation");
43324332
}
43334333

tests/test-mongoc-find-and-modify.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ test_find_and_modify_collation (int wire)
424424

425425
ASSERT_ERROR_CONTAINS (error,
426426
MONGOC_ERROR_COMMAND,
427-
MONGOC_ERROR_COMMAND_INVALID_ARG,
427+
MONGOC_ERROR_PROTOCOL_BAD_WIRE_VERSION,
428428
"The selected server does not support collation");
429429
ASSERT (!ok);
430430
}

0 commit comments

Comments
 (0)