diff options
Diffstat (limited to 'src/mongo/db/pipeline/pipeline_d.cpp')
-rw-r--r-- | src/mongo/db/pipeline/pipeline_d.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mongo/db/pipeline/pipeline_d.cpp b/src/mongo/db/pipeline/pipeline_d.cpp index e4e2e6bb67c..5dd74393a92 100644 --- a/src/mongo/db/pipeline/pipeline_d.cpp +++ b/src/mongo/db/pipeline/pipeline_d.cpp @@ -32,6 +32,7 @@ #include "mongo/db/pipeline/pipeline_d.h" +#include "mongo/bson/simple_bsonobj_comparator.h" #include "mongo/client/dbclientinterface.h" #include "mongo/db/catalog/collection.h" #include "mongo/db/catalog/database.h" @@ -138,7 +139,8 @@ public: const std::list<BSONObj>& originalIndexes) final { Lock::GlobalWrite globalLock(_ctx->opCtx->lockState()); - if (originalCollectionOptions != getCollectionOptions(targetNs)) { + if (SimpleBSONObjComparator::kInstance.evaluate(originalCollectionOptions != + getCollectionOptions(targetNs))) { return {ErrorCodes::CommandFailed, str::stream() << "collection options of target collection " << targetNs.ns() << " changed during processing. Original options: " @@ -146,7 +148,13 @@ public: << ", new options: " << getCollectionOptions(targetNs)}; } - if (originalIndexes != _client.getIndexSpecs(targetNs.ns())) { + + auto currentIndexes = _client.getIndexSpecs(targetNs.ns()); + if (originalIndexes.size() != currentIndexes.size() || + !std::equal(originalIndexes.begin(), + originalIndexes.end(), + currentIndexes.begin(), + SimpleBSONObjComparator::kInstance.makeEqualTo())) { return {ErrorCodes::CommandFailed, str::stream() << "indexes of target collection " << targetNs.ns() << " changed during processing."}; |