diff options
author | James Wahlin <james@mongodb.com> | 2017-11-14 16:16:01 -0500 |
---|---|---|
committer | James Wahlin <james@mongodb.com> | 2017-11-17 08:43:35 -0500 |
commit | 368f337eae2aab77b727fb91beb2d2bdd64ac53a (patch) | |
tree | 7183e5a9ba023927623ac7e31a34e70198ed6fb5 /src/mongo/db/pipeline/expression_test.cpp | |
parent | 4edcb8195a1ad4ffa20b9840c323913894376cdb (diff) | |
download | mongo-368f337eae2aab77b727fb91beb2d2bdd64ac53a.tar.gz |
SERVER-31962 Replace Variables::hasUserDefinedValue() with const val chk
Diffstat (limited to 'src/mongo/db/pipeline/expression_test.cpp')
-rw-r--r-- | src/mongo/db/pipeline/expression_test.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/db/pipeline/expression_test.cpp b/src/mongo/db/pipeline/expression_test.cpp index 6ada15ea651..b893229d6f0 100644 --- a/src/mongo/db/pipeline/expression_test.cpp +++ b/src/mongo/db/pipeline/expression_test.cpp @@ -2228,7 +2228,7 @@ TEST(FieldPath, NoOptimizationOnNormalPath) { TEST(FieldPath, OptimizeOnVariableWithConstantScalarValue) { intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); auto varId = expCtx->variablesParseState.defineVariable("userVar"); - expCtx->variables.setValue(varId, Value(123)); + expCtx->variables.setConstantValue(varId, Value(123)); auto expr = ExpressionFieldPath::parse(expCtx, "$$userVar", expCtx->variablesParseState); ASSERT_TRUE(dynamic_cast<ExpressionFieldPath*>(expr.get())); @@ -2240,7 +2240,7 @@ TEST(FieldPath, OptimizeOnVariableWithConstantScalarValue) { TEST(FieldPath, OptimizeOnVariableWithConstantArrayValue) { intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); auto varId = expCtx->variablesParseState.defineVariable("userVar"); - expCtx->variables.setValue(varId, Value(BSON_ARRAY(1 << 2 << 3))); + expCtx->variables.setConstantValue(varId, Value(BSON_ARRAY(1 << 2 << 3))); auto expr = ExpressionFieldPath::parse(expCtx, "$$userVar", expCtx->variablesParseState); ASSERT_TRUE(dynamic_cast<ExpressionFieldPath*>(expr.get())); @@ -2254,7 +2254,7 @@ TEST(FieldPath, OptimizeOnVariableWithConstantArrayValue) { TEST(FieldPath, OptimizeToEmptyArrayOnNumericalPathComponentAndConstantArrayValue) { intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); auto varId = expCtx->variablesParseState.defineVariable("userVar"); - expCtx->variables.setValue(varId, Value(BSON_ARRAY(1 << 2 << 3))); + expCtx->variables.setConstantValue(varId, Value(BSON_ARRAY(1 << 2 << 3))); auto expr = ExpressionFieldPath::parse(expCtx, "$$userVar.1", expCtx->variablesParseState); ASSERT_TRUE(dynamic_cast<ExpressionFieldPath*>(expr.get())); @@ -2268,7 +2268,7 @@ TEST(FieldPath, OptimizeToEmptyArrayOnNumericalPathComponentAndConstantArrayValu TEST(FieldPath, OptimizeOnVariableWithConstantValueAndDottedPath) { intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); auto varId = expCtx->variablesParseState.defineVariable("userVar"); - expCtx->variables.setValue(varId, Value(Document{{"x", Document{{"y", 123}}}})); + expCtx->variables.setConstantValue(varId, Value(Document{{"x", Document{{"y", 123}}}})); auto expr = ExpressionFieldPath::parse(expCtx, "$$userVar.x.y", expCtx->variablesParseState); ASSERT_TRUE(dynamic_cast<ExpressionFieldPath*>(expr.get())); @@ -2305,7 +2305,7 @@ TEST(FieldPath, NoOptimizationOnVariableWithMissingValue) { TEST(FieldPath, ScalarVariableWithDottedFieldPathOptimizesToConstantMissingValue) { intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); auto varId = expCtx->variablesParseState.defineVariable("userVar"); - expCtx->variables.setValue(varId, Value(123)); + expCtx->variables.setConstantValue(varId, Value(123)); auto expr = ExpressionFieldPath::parse(expCtx, "$$userVar.x.y", expCtx->variablesParseState); ASSERT_TRUE(dynamic_cast<ExpressionFieldPath*>(expr.get())); |