summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorJames Wahlin <james@mongodb.com>2022-05-17 15:11:42 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-05-26 20:15:41 +0000
commit2c53b7b684c8dd90044b8ef19932453088f54869 (patch)
tree5d5fae968e5beff431cee69b6cc54f0a26ef6009 /src/mongo/db
parent13389dc222fc372442be8c147e09685bb9a26a3a (diff)
downloadmongo-2c53b7b684c8dd90044b8ef19932453088f54869.tar.gz
SERVER-66310 Make ExpressionSetUnion::isCommutative() collation aware
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/pipeline/expression.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/db/pipeline/expression.h b/src/mongo/db/pipeline/expression.h
index fa59e89ecf2..7a2a2b139ee 100644
--- a/src/mongo/db/pipeline/expression.h
+++ b/src/mongo/db/pipeline/expression.h
@@ -2827,7 +2827,10 @@ public:
}
bool isCommutative() const final {
- return true;
+ // Only commutative when performing binary string comparison. The first value entered when
+ // multiple collation-equal but binary-unequal values are added will dictate what is stored
+ // in the set.
+ return getExpressionContext()->getCollator() == nullptr;
}
void acceptVisitor(ExpressionMutableVisitor* visitor) final {