From 81eaed9d178a63c3dda9ab7574f4ce4130a7d1ec Mon Sep 17 00:00:00 2001 From: James Wahlin Date: Thu, 8 Sep 2016 09:02:42 -0400 Subject: SERVER-26022 collMod should copy ViewDefinition before modifying --- src/mongo/db/views/view.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/mongo/db/views/view.cpp') 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; -- cgit v1.2.1