summaryrefslogtreecommitdiff
path: root/src/mongo/db/views/view.cpp
diff options
context:
space:
mode:
authorJames Wahlin <james.wahlin@10gen.com>2016-09-08 09:02:42 -0400
committerJames Wahlin <james.wahlin@10gen.com>2016-09-08 15:45:07 -0400
commit81eaed9d178a63c3dda9ab7574f4ce4130a7d1ec (patch)
tree0f15c18257fac30d74f8e6f94d5313dca4bf096b /src/mongo/db/views/view.cpp
parent730dc4a5feb10426a38238769f7270c2f5f66ea1 (diff)
downloadmongo-81eaed9d178a63c3dda9ab7574f4ce4130a7d1ec.tar.gz
SERVER-26022 collMod should copy ViewDefinition before modifying
Diffstat (limited to 'src/mongo/db/views/view.cpp')
-rw-r--r--src/mongo/db/views/view.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/views/view.cpp b/src/mongo/db/views/view.cpp
index 74920ecb15a..53815fd86f3 100644
--- a/src/mongo/db/views/view.cpp
+++ b/src/mongo/db/views/view.cpp
@@ -53,6 +53,15 @@ ViewDefinition::ViewDefinition(const ViewDefinition& other)
_collator(CollatorInterface::cloneCollator(other._collator.get())),
_pipeline(other._pipeline) {}
+ViewDefinition& ViewDefinition::operator=(const ViewDefinition& other) {
+ _viewNss = other._viewNss;
+ _viewOnNss = other._viewOnNss;
+ _collator = CollatorInterface::cloneCollator(other._collator.get());
+ _pipeline = other._pipeline;
+
+ return *this;
+}
+
void ViewDefinition::setViewOn(const NamespaceString& viewOnNss) {
invariant(_viewNss.db() == viewOnNss.db());
_viewOnNss = viewOnNss;