diff options
author | James Wahlin <james@mongodb.com> | 2022-05-17 15:11:42 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-05-26 20:15:41 +0000 |
commit | 2c53b7b684c8dd90044b8ef19932453088f54869 (patch) | |
tree | 5d5fae968e5beff431cee69b6cc54f0a26ef6009 /src/mongo/db | |
parent | 13389dc222fc372442be8c147e09685bb9a26a3a (diff) | |
download | mongo-2c53b7b684c8dd90044b8ef19932453088f54869.tar.gz |
SERVER-66310 Make ExpressionSetUnion::isCommutative() collation aware
Diffstat (limited to 'src/mongo/db')
-rw-r--r-- | src/mongo/db/pipeline/expression.h | 5 |
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 { |