summaryrefslogtreecommitdiff
path: root/s/d_split.cpp
diff options
context:
space:
mode:
authorAntonin Kral <a.kral@bobek.cz>2011-06-18 21:24:41 +0200
committerAntonin Kral <a.kral@bobek.cz>2011-06-18 21:24:41 +0200
commit64b33ee522375a8dc15be2875dfb7db4502259b0 (patch)
tree44979e0aaf6bb576f4a737a93e071e28809b6779 /s/d_split.cpp
parent4d87ff4aa74d7ae975268ac43eee152dc3f5b7e9 (diff)
downloadmongodb-64b33ee522375a8dc15be2875dfb7db4502259b0.tar.gz
Imported Upstream version 1.8.2
Diffstat (limited to 's/d_split.cpp')
-rw-r--r--s/d_split.cpp8
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;