diff options
author | James Wahlin <james@mongodb.com> | 2022-05-17 15:11:42 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-07-21 13:36:54 +0000 |
commit | 3c2e77f7098157bcb30aa50f2ce3e0b53bb49a01 (patch) | |
tree | 54efc42324f860c1efbe242cfed0c8a58e8f8c00 /src/mongo/db/pipeline | |
parent | 92bbf4379baaf338b3942702961e1dcb6957bb9d (diff) | |
download | mongo-3c2e77f7098157bcb30aa50f2ce3e0b53bb49a01.tar.gz |
SERVER-66310 Make ExpressionSetUnion::isCommutative() collation aware
(cherry picked from commit 2c53b7b684c8dd90044b8ef19932453088f54869)
Diffstat (limited to 'src/mongo/db/pipeline')
-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 9cce6d0b1e2..1efea3742d4 100644 --- a/src/mongo/db/pipeline/expression.h +++ b/src/mongo/db/pipeline/expression.h @@ -2860,7 +2860,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 { |