diff options
author | Antonin Kral <a.kral@bobek.cz> | 2011-06-18 21:24:41 +0200 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2011-06-18 21:24:41 +0200 |
commit | 64b33ee522375a8dc15be2875dfb7db4502259b0 (patch) | |
tree | 44979e0aaf6bb576f4a737a93e071e28809b6779 /s/d_split.cpp | |
parent | 4d87ff4aa74d7ae975268ac43eee152dc3f5b7e9 (diff) | |
download | mongodb-64b33ee522375a8dc15be2875dfb7db4502259b0.tar.gz |
Imported Upstream version 1.8.2
Diffstat (limited to 's/d_split.cpp')
-rw-r--r-- | s/d_split.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/s/d_split.cpp b/s/d_split.cpp index 66fe38e..3ed6e9b 100644 --- a/s/d_split.cpp +++ b/s/d_split.cpp @@ -138,6 +138,11 @@ namespace mongo { const char* ns = jsobj.getStringField( "checkShardingIndex" ); BSONObj keyPattern = jsobj.getObjectField( "keyPattern" ); + if ( keyPattern.nFields() == 1 && str::equals( "_id" , keyPattern.firstElement().fieldName() ) ) { + result.appendBool( "idskip" , true ); + return true; + } + // If min and max are not provided use the "minKey" and "maxKey" for the sharding key pattern. BSONObj min = jsobj.getObjectField( "min" ); BSONObj max = jsobj.getObjectField( "max" ); @@ -211,6 +216,9 @@ namespace mongo { return false; } cc->advance(); + + if ( ! cc->yieldSometimes() ) + break; } return true; |