diff options
author | James Wahlin <james.wahlin@10gen.com> | 2016-09-08 09:02:42 -0400 |
---|---|---|
committer | James Wahlin <james.wahlin@10gen.com> | 2016-09-08 15:45:07 -0400 |
commit | 81eaed9d178a63c3dda9ab7574f4ce4130a7d1ec (patch) | |
tree | 0f15c18257fac30d74f8e6f94d5313dca4bf096b /src/mongo/db/views/view.cpp | |
parent | 730dc4a5feb10426a38238769f7270c2f5f66ea1 (diff) | |
download | mongo-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.cpp | 9 |
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; |