diff options
author | Claire Childs <claire.childs@mongodb.com> | 2020-09-16 22:43:13 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-09-16 23:10:14 +0000 |
commit | 805fbca1f08295451080f8d845699a00fff88d9a (patch) | |
tree | 0b936446781c855133a7b770bd37e07eb25d16bf /src/mongo/db/exec | |
parent | b0f66da822b0771a7a00539fc5935647740425ca (diff) | |
download | mongo-805fbca1f08295451080f8d845699a00fff88d9a.tar.gz |
SERVER-50663 Fix for BSONObj copy in SBECoerceToStringTest and SBEToUpperToLowerTest
Diffstat (limited to 'src/mongo/db/exec')
-rw-r--r-- | src/mongo/db/exec/sbe/expressions/sbe_coerce_to_string_test.cpp | 4 | ||||
-rw-r--r-- | src/mongo/db/exec/sbe/expressions/sbe_to_upper_to_lower_test.cpp | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/mongo/db/exec/sbe/expressions/sbe_coerce_to_string_test.cpp b/src/mongo/db/exec/sbe/expressions/sbe_coerce_to_string_test.cpp index cdc1a6f8acd..bc4c4c6f974 100644 --- a/src/mongo/db/exec/sbe/expressions/sbe_coerce_to_string_test.cpp +++ b/src/mongo/db/exec/sbe/expressions/sbe_coerce_to_string_test.cpp @@ -101,8 +101,8 @@ TEST_F(SBECoerceToStringTest, BasicCoerceToString) { // BSONObj test. auto bsonObj = BSON("number" << 42); - auto bsonNum = value::bitcastFrom(bsonObj["number"].value()); - auto [bsonTag, bsonVal] = value::copyValue(value::TypeTags::bsonObject, bsonNum); + auto bsonData = value::bitcastFrom(bsonObj.objdata()); + auto [bsonTag, bsonVal] = value::copyValue(value::TypeTags::bsonObject, bsonData); coerceToStringAccessor.reset(bsonTag, bsonVal); runAndAssertNothing(compiledExpr.get()); diff --git a/src/mongo/db/exec/sbe/expressions/sbe_to_upper_to_lower_test.cpp b/src/mongo/db/exec/sbe/expressions/sbe_to_upper_to_lower_test.cpp index dc9023b8c05..a484a588d24 100644 --- a/src/mongo/db/exec/sbe/expressions/sbe_to_upper_to_lower_test.cpp +++ b/src/mongo/db/exec/sbe/expressions/sbe_to_upper_to_lower_test.cpp @@ -102,8 +102,8 @@ TEST_F(SBEToUpperToLowerTest, BasicToUpper) { // BSONObj test. auto bsonObj = BSON("number" << 42); - auto bsonNum = value::bitcastFrom(bsonObj["number"].value()); - auto [bsonTag, bsonVal] = value::copyValue(value::TypeTags::bsonObject, bsonNum); + auto bsonData = value::bitcastFrom(bsonObj.objdata()); + auto [bsonTag, bsonVal] = value::copyValue(value::TypeTags::bsonObject, bsonData); toUpperAccessor.reset(bsonTag, bsonVal); runAndAssertNothing(compiledExpr.get()); @@ -170,8 +170,8 @@ TEST_F(SBEToUpperToLowerTest, BasicToLower) { // BSONObj test. auto bsonObj = BSON("number" << 42); - auto bsonNum = value::bitcastFrom(bsonObj["number"].value()); - auto [bsonTag, bsonVal] = value::copyValue(value::TypeTags::bsonObject, bsonNum); + auto bsonData = value::bitcastFrom(bsonObj.objdata()); + auto [bsonTag, bsonVal] = value::copyValue(value::TypeTags::bsonObject, bsonData); toLowerAccessor.reset(bsonTag, bsonVal); runAndAssertNothing(compiledExpr.get()); |