diff options
author | Siyuan Zhou <siyuan.zhou@mongodb.com> | 2017-11-13 18:50:20 -0500 |
---|---|---|
committer | Siyuan Zhou <siyuan.zhou@mongodb.com> | 2017-11-21 16:48:54 -0500 |
commit | 60929bb3b6c8df3c620f61b09d90c14d64dd31ef (patch) | |
tree | 2fd1ae7271c25ff9cace4099b2f2592495ee4c0c /jstests/libs | |
parent | 30de2f7c46a9aa0914fe91cba2075b244e9b516b (diff) | |
download | mongo-60929bb3b6c8df3c620f61b09d90c14d64dd31ef.tar.gz |
SERVER-31476 Server should prohibit establishing a cursor on a read-only view
Diffstat (limited to 'jstests/libs')
-rw-r--r-- | jstests/libs/override_methods/set_read_and_write_concerns.js | 3 | ||||
-rw-r--r-- | jstests/libs/override_methods/set_read_preference_secondary.js | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/jstests/libs/override_methods/set_read_and_write_concerns.js b/jstests/libs/override_methods/set_read_and_write_concerns.js index dbcbbf2bcb1..8bbf29226f2 100644 --- a/jstests/libs/override_methods/set_read_and_write_concerns.js +++ b/jstests/libs/override_methods/set_read_and_write_concerns.js @@ -52,6 +52,7 @@ return originalStartParallelShell(newCode, port, noConnect); }; + const originalRunCommand = DB.prototype._runCommandImpl; DB.prototype._runCommandImpl = function(dbName, obj, options) { var cmdName = ""; for (var fieldName in obj) { @@ -178,7 +179,7 @@ } } - var res = this.getMongo().runCommand(dbName, obj, options); + var res = originalRunCommand.call(this, dbName, obj, options); return res; }; diff --git a/jstests/libs/override_methods/set_read_preference_secondary.js b/jstests/libs/override_methods/set_read_preference_secondary.js index 98fbdbe4f4c..9955c7f016d 100644 --- a/jstests/libs/override_methods/set_read_preference_secondary.js +++ b/jstests/libs/override_methods/set_read_preference_secondary.js @@ -37,6 +37,7 @@ "parallelCollectionScan", ]); + const originalRunCommand = DB.prototype._runCommandImpl; DB.prototype._runCommandImpl = function(dbName, obj, options) { const cmdName = Object.keys(obj)[0]; @@ -62,7 +63,7 @@ } } - return this.getMongo().runCommand(dbName, obj, options); + return originalRunCommand.call(this, dbName, obj, options); }; })(); |