diff options
author | Adam Midvidy <amidvidy@gmail.com> | 2016-02-24 14:19:19 -0500 |
---|---|---|
committer | Adam Midvidy <amidvidy@gmail.com> | 2016-02-24 22:14:26 -0500 |
commit | c29b47c0926fa1422ed742648dab419e34bb92d2 (patch) | |
tree | 00285dbc82959b5d65ce2bec122c5e47be10953e /jstests/readonly | |
parent | 3a5c0f9bcb46f083863622e0d734cf29023e7275 (diff) | |
download | mongo-c29b47c0926fa1422ed742648dab419e34bb92d2.tar.gz |
SERVER-22360 disallow external sort in readOnly mode
Diffstat (limited to 'jstests/readonly')
-rw-r--r-- | jstests/readonly/aggregate.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/jstests/readonly/aggregate.js b/jstests/readonly/aggregate.js index 3bfaeab6a20..5710dec9139 100644 --- a/jstests/readonly/aggregate.js +++ b/jstests/readonly/aggregate.js @@ -93,6 +93,16 @@ runReadOnlyTest(function() { {_id: "The Revenant", count: 3}, {_id: "Spotlight", count: 3} ]); + + // Check that pipelines fail with allowDiskUse true. We use runCommand manually because + // the helper has conflicting error handling logic. + var allowDiskUseCmd = {aggregate: readableCollection.getName(), + pipeline: [], + allowDiskUse: true}; + + assert.commandFailedWithCode(readableCollection.runCommand(allowDiskUseCmd), + ErrorCodes.IllegalOperation, + "'allowDiskUse' is not allowed in read-only mode"); } }; }()); |