diff options
author | Tess Avitabile <tess.avitabile@mongodb.com> | 2017-06-02 15:29:32 -0400 |
---|---|---|
committer | Tess Avitabile <tess.avitabile@mongodb.com> | 2017-06-09 15:05:04 -0400 |
commit | 67500efdc1c677173c737ecde2b07b42015ae5fd (patch) | |
tree | 4a735cf4c6561e28b76f65117d47231e9a677d04 /jstests/decimal | |
parent | f9c36696a25d3837f512421755952736236bbed0 (diff) | |
download | mongo-67500efdc1c677173c737ecde2b07b42015ae5fd.tar.gz |
SERVER-29350 Bump featureCompatibilityVersion to 3.6
Diffstat (limited to 'jstests/decimal')
-rw-r--r-- | jstests/decimal/decimal_feature_compatibility_version.js | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/jstests/decimal/decimal_feature_compatibility_version.js b/jstests/decimal/decimal_feature_compatibility_version.js deleted file mode 100644 index 7123c28e0fc..00000000000 --- a/jstests/decimal/decimal_feature_compatibility_version.js +++ /dev/null @@ -1,58 +0,0 @@ -// Test that decimal usage is restricted when the featureCompatibilityVersion is 3.2. - -(function() { - "use strict"; - - // Decimal data with feature compatibility version 3.2 causes collection - // validation failure. - // TODO: SERVER-29350 Remove this code when feature compatibility version 3.2 is removed. - TestData.skipCollectionAndIndexValidation = true; - - const conn = MongoRunner.runMongod({}); - assert.neq(null, conn, "mongod was unable to start up"); - - const decimalDB = conn.getDB("decimal_feature_compatibility_version"); - assert.commandWorked(decimalDB.dropDatabase()); - assert.commandWorked(decimalDB.runCommand({create: "collection"})); - - const adminDB = conn.getDB("admin"); - - // Ensure the featureCompatibilityVersion is 3.4. - assert.commandWorked(adminDB.runCommand({setFeatureCompatibilityVersion: "3.4"})); - let res = adminDB.runCommand({getParameter: 1, featureCompatibilityVersion: 1}); - assert.commandWorked(res); - assert.eq("3.4", res.featureCompatibilityVersion); - - // Decimals can be inserted when the featureCompatibilityVersion is 3.4. - assert.writeOK(decimalDB.collection.insert({a: NumberDecimal(2.0)})); - - // Collection containing decimals is valid when the featureCompatibilityVersion is 3.4. - res = decimalDB.collection.validate({full: true}); - assert.commandWorked(res); - assert.eq(true, res.valid, tojson(res)); - - // Ensure the featureCompatibilityVersion is 3.2. - assert.commandWorked(adminDB.runCommand({setFeatureCompatibilityVersion: "3.2"})); - res = adminDB.runCommand({getParameter: 1, featureCompatibilityVersion: 1}); - assert.commandWorked(res); - assert.eq("3.2", res.featureCompatibilityVersion); - - // Decimals cannot be inserted when the featureCompatibilityVersion is 3.2. - assert.writeErrorWithCode(decimalDB.collection.insert({a: NumberDecimal(2.0)}), - ErrorCodes.InvalidBSON); - - // Decimals cannot be used in queries when the featureCompatibilityVersion is 3.2. - assert.throws(function() { - decimalDB.collection.findOne({a: NumberDecimal(2.0)}); - }); - - // Decimals can be read when the featureCompatibilityVersion is 3.2. - assert.eq(decimalDB.collection.findOne().a, NumberDecimal(2.0)); - - // Collection containing decimals is invalid when the featureCompatibilityVersion is 3.2. - res = decimalDB.collection.validate({full: true}); - assert.commandWorked(res); - assert.eq(false, res.valid, tojson(res)); - - MongoRunner.stopMongod(conn); -}()); |