diff options
author | David Storch <david.storch@10gen.com> | 2016-05-24 15:28:40 -0400 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2016-05-25 14:40:31 -0400 |
commit | 59ca0648a8a7627edb12e160464cf014fd7af07e (patch) | |
tree | 84a55a6b71d6af81a1cb23f262a85a8283315651 /src/mongo/db/catalog/collection_options.cpp | |
parent | 439df4c3bdff0194cff402a6268a9bdb9de44a7a (diff) | |
download | mongo-59ca0648a8a7627edb12e160464cf014fd7af07e.tar.gz |
SERVER-23945 make index builds without a collation inherit the collection default
Also ensures that the full BSON representation of the
collation spec associated with an index or with a collection
is materialized in the catalog.
Diffstat (limited to 'src/mongo/db/catalog/collection_options.cpp')
-rw-r--r-- | src/mongo/db/catalog/collection_options.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mongo/db/catalog/collection_options.cpp b/src/mongo/db/catalog/collection_options.cpp index 1595706c0e2..b2aa3da4de4 100644 --- a/src/mongo/db/catalog/collection_options.cpp +++ b/src/mongo/db/catalog/collection_options.cpp @@ -215,6 +215,10 @@ Status CollectionOptions::parse(const BSONObj& options) { return Status(ErrorCodes::BadValue, "'collation' has to be a document."); } + if (e.Obj().isEmpty()) { + return Status(ErrorCodes::BadValue, "'collation' cannot be an empty document."); + } + collation = e.Obj().getOwned(); } } |