diff options
author | Gregory Noma <gregory.noma@gmail.com> | 2022-10-26 13:43:18 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-10-26 15:01:34 +0000 |
commit | 57e7b1823f64d10927bed31281ae024e77be8db0 (patch) | |
tree | 622e20ad0f39265abd48ab816efd15a2a0deb884 /jstests | |
parent | 3c2c643e1ae6c0ec51582b565c894f5648f682fc (diff) | |
download | mongo-57e7b1823f64d10927bed31281ae024e77be8db0.tar.gz |
SERVER-70649 Test `CollectionUUIDMismatch` with write commands on view
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/core/collection_uuid_write_commands.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/jstests/core/collection_uuid_write_commands.js b/jstests/core/collection_uuid_write_commands.js index 080ce1772d5..ff9781ec090 100644 --- a/jstests/core/collection_uuid_write_commands.js +++ b/jstests/core/collection_uuid_write_commands.js @@ -2,7 +2,7 @@ * Tests the collectionUUID parameter of the insert, update and delete commands. * * @tags: [ - * requires_fcv_60, + * requires_fcv_62, * tenant_migration_incompatible, * ] */ @@ -64,6 +64,17 @@ var testCommand = function(cmd, cmdObj) { validateErrorResponse(res, testDB.getName(), uuid, coll2.getName(), coll.getName()); assert(!testDB.getCollectionNames().includes(coll2.getName())); + jsTestLog( + "The command '" + cmd + + "' fails with CollectionUUIDMismatch when the provided UUID corresponds to a different " + + "collection, even if the provided namespace is a view."); + const view = 'view'; + assert.commandWorked(testDB.createView(view, coll.getName(), [])); + cmdObj[cmd] = view; + res = + assert.commandFailedWithCode(testDB.runCommand(cmdObj), ErrorCodes.CollectionUUIDMismatch); + validateErrorResponse(res, testDB.getName(), uuid, view, coll.getName()); + jsTestLog("The command '" + cmd + "' fails with CollectionUUIDMismatch even if the database does not exist."); const nonexistentDB = testDB.getSiblingDB(testDB.getName() + '_nonexistent'); |