summaryrefslogtreecommitdiff
path: root/src/mongo/db/matcher
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2021-07-16 13:20:32 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-08-03 14:24:28 +0000
commitd5283d41cc543e9b25d9aaa100e5dcc3208b5b93 (patch)
tree3d6fd0abf92c4666da248ac12349c03223a6f5f1 /src/mongo/db/matcher
parent1d78606066a00d40757a29b73380d73dde931c63 (diff)
downloadmongo-d5283d41cc543e9b25d9aaa100e5dcc3208b5b93.tar.gz
SERVER-58612 Add Column as BSON Binary Subtype 7
Diffstat (limited to 'src/mongo/db/matcher')
-rw-r--r--src/mongo/db/matcher/expression_type_test.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/db/matcher/expression_type_test.cpp b/src/mongo/db/matcher/expression_type_test.cpp
index 70f924cdf5f..13ef52affe4 100644
--- a/src/mongo/db/matcher/expression_type_test.cpp
+++ b/src/mongo/db/matcher/expression_type_test.cpp
@@ -257,6 +257,14 @@ TEST(ExpressionBinDataSubTypeTest, MatchesBinDataEncryptType) {
ASSERT_FALSE(type.matchesSingleElement(notMatch["a"]));
}
+TEST(ExpressionBinDataSubTypeTest, MatchesBinDataColumnType) {
+ BSONObj match = BSON("a" << BSONBinData(nullptr, 0, BinDataType::Column));
+ BSONObj notMatch = BSON("a" << BSONBinData(nullptr, 0, BinDataType::newUUID));
+ InternalSchemaBinDataSubTypeExpression type("", BinDataType::Column);
+ ASSERT_TRUE(type.matchesSingleElement(match["a"]));
+ ASSERT_FALSE(type.matchesSingleElement(notMatch["a"]));
+}
+
TEST(ExpressionBinDataSubTypeTest, MatchesBinDataBdtCustom) {
BSONObj match = BSON("a" << BSONBinData(nullptr, 0, BinDataType::bdtCustom));
BSONObj notMatch = BSON("a" << BSONBinData(nullptr, 0, BinDataType::Function));