diff options
author | David Storch <david.storch@10gen.com> | 2016-10-18 17:48:07 -0400 |
---|---|---|
committer | David Storch <david.storch@10gen.com> | 2016-10-20 15:44:40 -0400 |
commit | 315f92405c5f5e5f4159ccbb55b0352cfe235852 (patch) | |
tree | 1d00ff8e50968e79936c19154170248bbbdd2672 /src/mongo/db/catalog/index_catalog.cpp | |
parent | 278bdb38318f84e0019982e4124e05ac22db05d2 (diff) | |
download | mongo-315f92405c5f5e5f4159ccbb55b0352cfe235852.tar.gz |
SERVER-26659 only use stricter key pattern validation for v:2 or new index builds
This now follows the same rules which we will use in 3.4 for
rejecting unknown top-level options in the index spec. These
rules ensure a smooth upgrade, even in the presence of bad
index metadata produced on an older server version.
Diffstat (limited to 'src/mongo/db/catalog/index_catalog.cpp')
-rw-r--r-- | src/mongo/db/catalog/index_catalog.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/db/catalog/index_catalog.cpp b/src/mongo/db/catalog/index_catalog.cpp index 1357ed8c963..a4c484c5a53 100644 --- a/src/mongo/db/catalog/index_catalog.cpp +++ b/src/mongo/db/catalog/index_catalog.cpp @@ -562,7 +562,7 @@ Status IndexCatalog::_isSpecOk(OperationContext* txn, const BSONObj& spec) const << "\" is too long (127 byte max)"); const BSONObj key = spec.getObjectField("key"); - const Status keyStatus = validateKeyPattern(key); + const Status keyStatus = validateKeyPattern(key, indexVersion); if (!keyStatus.isOK()) { return Status(ErrorCodes::CannotCreateIndex, str::stream() << "bad index key pattern " << key << ": " |