diff options
author | Irina Yatsenko <irina.yatsenko@mongodb.com> | 2021-07-07 15:44:54 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-07-16 05:38:55 +0000 |
commit | beeab6beaf18232e52bb3094f5f31fe83fbae2a4 (patch) | |
tree | dce5b9fefa813283212757dcf16f59e4b8bffe9e /src/mongo/client/dbclient_cursor.cpp | |
parent | 23ecc48f89f4ec03d7b42e637c5969802efdb261 (diff) | |
download | mongo-beeab6beaf18232e52bb3094f5f31fe83fbae2a4.tar.gz |
SERVER-57391 Return error response to OP_QUERY and OP_GET_MORE messages
Diffstat (limited to 'src/mongo/client/dbclient_cursor.cpp')
-rw-r--r-- | src/mongo/client/dbclient_cursor.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mongo/client/dbclient_cursor.cpp b/src/mongo/client/dbclient_cursor.cpp index 6c5db1bd6d1..db9cc55d6f3 100644 --- a/src/mongo/client/dbclient_cursor.cpp +++ b/src/mongo/client/dbclient_cursor.cpp @@ -109,7 +109,7 @@ Message DBClientCursor::_assembleInit() { // so we need to allow the shell to send invalid options so that we can // test that the server rejects them. Thus, to allow generating commands with // invalid options, we validate them here, and fall back to generating an OP_QUERY - // through makeQueryMessage() if the options are invalid. + // through makeDeprecatedQueryMessage() if the options are invalid. bool hasValidNToReturnForCommand = (nToReturn == 1 || nToReturn == -1); bool hasValidFlagsForCommand = !(opts & mongo::QueryOption_Exhaust); bool hasInvalidMaxTimeMs = query.hasField("$maxTimeMS"); @@ -175,7 +175,8 @@ Message DBClientCursor::_assembleInit() { } _useFindCommand = false; // Make sure we handle the reply correctly. - return makeQueryMessage(ns.ns(), query, nextBatchSize(), nToSkip, fieldsToReturn, opts); + return makeDeprecatedQueryMessage( + ns.ns(), query, nextBatchSize(), nToSkip, fieldsToReturn, opts); } Message DBClientCursor::_assembleGetMore() { @@ -200,7 +201,7 @@ Message DBClientCursor::_assembleGetMore() { return msg; } else { // Assemble a legacy getMore request. - return makeGetMoreMessage(ns.ns(), cursorId, nextBatchSize(), opts); + return makeDeprecatedGetMoreMessage(ns.ns(), cursorId, nextBatchSize(), opts); } } @@ -642,7 +643,7 @@ void DBClientCursor::kill() { if (_useFindCommand) { conn->killCursor(ns, cursorId); } else { - auto toSend = makeKillCursorsMessage(cursorId); + auto toSend = makeDeprecatedKillCursorsMessage(cursorId); conn->say(toSend); } }; |