summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorTess Avitabile <tess.avitabile@mongodb.com>2016-08-31 15:10:43 -0400
committerTess Avitabile <tess.avitabile@mongodb.com>2016-09-07 17:59:15 -0400
commit5559f16e634af69bcbcc4f8dd6d03e74a40729b9 (patch)
treebcdb4748bde99f33266e74666ff6d3525d3f8b39 /jstests
parent071065a2969176ad2aa2ac9c3210e5fa9410cea6 (diff)
downloadmongo-5559f16e634af69bcbcc4f8dd6d03e74a40729b9.tar.gz
SERVER-25741 Disallow collection default collation if featureCompatibilityVersion is 3.2
Diffstat (limited to 'jstests')
-rw-r--r--jstests/noPassthrough/collation_feature_compatibility_version.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/jstests/noPassthrough/collation_feature_compatibility_version.js b/jstests/noPassthrough/collation_feature_compatibility_version.js
index df3516b2b3e..2f393c2a99a 100644
--- a/jstests/noPassthrough/collation_feature_compatibility_version.js
+++ b/jstests/noPassthrough/collation_feature_compatibility_version.js
@@ -29,6 +29,25 @@
assert.commandWorked(res);
assert.eq("3.2", res.featureCompatibilityVersion);
+ // We cannot create a collection with a default collation when the featureCompatibilityVersion
+ // is 3.2.
+ assert.commandFailed(
+ collationDB.createCollection("collection", {collation: {locale: "fr_CA"}}));
+
+ // We cannot explicitly give a collection the simple collation as its default when the
+ // featureCompatibilityVersion is 3.2.
+ assert.commandFailed(
+ collationDB.createCollection("collection", {collation: {locale: "simple"}}));
+
+ // We cannot create a view with a default collation when the featureCompatibilityVersion is 3.2.
+ assert.commandFailed(collationDB.runCommand(
+ {create: "view", viewOn: "caseInsensitive", collation: {locale: "fr_CA"}}));
+
+ // We cannot explicitly give a view the simple collation as its default when the
+ // featureCompatibilityVersion is 3.2.
+ assert.commandFailed(collationDB.runCommand(
+ {create: "view", viewOn: "caseInsensitive", collation: {locale: "simple"}}));
+
// All operations reject the collation parameter when the featureCompatibilityVersion is 3.2.
assert.throws(function() {
caseInsensitive.aggregate([], {collation: {locale: "en_US"}});