summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorAli Mir <ali.mir@mongodb.com>2020-11-05 14:34:39 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-11-05 16:00:17 +0000
commiteac07b8c0b896f4fab4f64a3cd2adc5a9c14219f (patch)
tree13feef15e3f01afdd0f12e8f4cc0ece60b36c8ac /jstests
parent1118ad680f76ac29795c8396beb11b0b50322f20 (diff)
downloadmongo-eac07b8c0b896f4fab4f64a3cd2adc5a9c14219f.tar.gz
Revert "SERVER-51540 Support mod expression in SBE"
This reverts commit 3509b1b58532dd7134c4d0610bba8867f60622d9.
Diffstat (limited to 'jstests')
-rw-r--r--jstests/aggregation/sources/merge/mode_replace_insert.js3
-rw-r--r--jstests/core/projection_expr_mod.js79
-rw-r--r--jstests/libs/sbe_assert_error_override.js1
3 files changed, 3 insertions, 80 deletions
diff --git a/jstests/aggregation/sources/merge/mode_replace_insert.js b/jstests/aggregation/sources/merge/mode_replace_insert.js
index 1975365ae06..07791658496 100644
--- a/jstests/aggregation/sources/merge/mode_replace_insert.js
+++ b/jstests/aggregation/sources/merge/mode_replace_insert.js
@@ -1,4 +1,7 @@
// Tests for the $merge stage with whenMatched: "replace" and whenNotMatched: "insert".
+// @tags: [
+// sbe_incompatible,
+// ]
(function() {
"use strict";
diff --git a/jstests/core/projection_expr_mod.js b/jstests/core/projection_expr_mod.js
deleted file mode 100644
index e06c7b9224f..00000000000
--- a/jstests/core/projection_expr_mod.js
+++ /dev/null
@@ -1,79 +0,0 @@
-// Confirm correctness of $mod evaluation in find projection.
-
-(function() {
-"use strict";
-
-load("jstests/aggregation/extras/utils.js"); // For assertArrayEq.
-load("jstests/libs/sbe_assert_error_override.js"); // Override error-code-checking APIs.
-
-const coll = db.projection_expr_mod;
-coll.drop();
-
-assert.commandWorked(coll.insertMany([
- {n: "double % double", v: 138.5, m: 3.0},
- {n: "double % long", v: 138.5, m: NumberLong(3)},
- {n: "double % int", v: 138.5, m: NumberInt(3)},
- {n: "int % double", v: NumberInt(8), m: 3.25},
- {n: "int % double int", v: NumberInt(8), m: 3.0},
- {n: "int % int", v: NumberInt(8), m: NumberInt(3)},
- {n: "int % long", v: NumberInt(8), m: NumberLong(3)},
- {n: "long % double", v: NumberLong(8), m: 3.25},
- {n: "long % double int", v: NumberLong(8), m: 3.0},
- {n: "long % double long", v: NumberLong(500000000000), m: 450000000000.0},
- {n: "long % int", v: NumberLong(8), m: NumberInt(3)},
- {n: "long % long", v: NumberLong(8), m: NumberLong(3)},
- {n: "very long % very long", v: NumberLong(800000000000), m: NumberLong(300000000000)}
-]));
-
-const result = coll.find({}, {f: {$mod: ["$v", "$m"]}, _id: 0, n: 1}).toArray();
-const expectedResult = [
- {n: "double % double", f: 0.5},
- {n: "double % long", f: 0.5},
- {n: "double % int", f: 0.5},
- {n: "int % double", f: 1.5},
- {n: "int % double int", f: 2},
- {n: "int % int", f: 2},
- {n: "int % long", f: NumberLong(2)},
- {n: "long % double", f: 1.5},
- {n: "long % double int", f: NumberLong(2)},
- {n: "long % double long", f: 50000000000},
- {n: "long % int", f: NumberLong(2)},
- {n: "long % long", f: NumberLong(2)},
- {n: "very long % very long", f: NumberLong(200000000000)}
-];
-assertArrayEq({actual: result, expected: expectedResult});
-
-//
-// Confirm error cases.
-//
-
-// Confirm mod by 0 fails in an expected manner.
-assert(coll.drop());
-assert.commandWorked(coll.insert({a: 10}));
-let error = assert.throws(() => coll.find({}, {f: {$mod: ["$a", 0]}, _id: 0, n: 1}).toArray());
-assert.commandFailedWithCode(error, 4848403);
-
-assert(coll.drop());
-assert.commandWorked(coll.insert({a: NumberInt(10)}));
-error =
- assert.throws(() => coll.find({}, {f: {$mod: ["$a", NumberInt(0)]}, _id: 0, n: 1}).toArray());
-assert.commandFailedWithCode(error, 4848403);
-
-assert(coll.drop());
-assert.commandWorked(coll.insert({a: NumberLong(10)}));
-error =
- assert.throws(() => coll.find({}, {f: {$mod: ["$a", NumberLong(0)]}, _id: 0, n: 1}).toArray());
-assert.commandFailedWithCode(error, 4848403);
-
-// Clear collection again and reset.
-assert(coll.drop());
-assert.commandWorked(coll.insert({a: 10}));
-
-// Confirm expected behavior for NaN and Infinity values.
-assert.eq(coll.findOne({}, {f: {$mod: ["$a", NaN]}, _id: 0}), {f: NaN});
-assert.eq(coll.findOne({}, {f: {$mod: ["$a", Infinity]}, _id: 0}), {f: 10});
-assert.eq(coll.findOne({}, {f: {$mod: ["$a", -Infinity]}, _id: 0}), {f: 10});
-assert.eq(coll.findOne({}, {f: {$mod: [Infinity, "$a"]}, _id: 0}), {f: NaN});
-assert.eq(coll.findOne({}, {f: {$mod: [-Infinity, "$a"]}, _id: 0}), {f: NaN});
-assert.eq(coll.findOne({}, {f: {$mod: [NaN, "$a"]}, _id: 0}), {f: NaN});
-})(); \ No newline at end of file
diff --git a/jstests/libs/sbe_assert_error_override.js b/jstests/libs/sbe_assert_error_override.js
index 5ebfa28410f..8d6147bccd9 100644
--- a/jstests/libs/sbe_assert_error_override.js
+++ b/jstests/libs/sbe_assert_error_override.js
@@ -30,7 +30,6 @@ const equivalentErrorCodesList = [
[16007, 5066300],
[16608, 4848401],
[16609, 5073101],
- [16610, 4848403],
[16555, 5073102],
[28680, 4903701],
[28689, 5126701],