From 8d913e98e8058c6322975a858f884a769735bb43 Mon Sep 17 00:00:00 2001 From: Antonin Kral Date: Thu, 7 Apr 2011 07:35:46 +0200 Subject: Imported Upstream version 1.8.1 --- s/d_split.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 's/d_split.cpp') diff --git a/s/d_split.cpp b/s/d_split.cpp index 0896803..66fe38e 100644 --- a/s/d_split.cpp +++ b/s/d_split.cpp @@ -269,7 +269,7 @@ namespace mongo { maxSplitPoints = maxSplitPointsElem.numberLong(); } - long long maxChunkObjects = 0; + long long maxChunkObjects = Chunk::MaxObjectPerChunk; BSONElement MaxChunkObjectsElem = jsobj[ "maxChunkObjects" ]; if ( MaxChunkObjectsElem.isNumber() ) { maxChunkObjects = MaxChunkObjectsElem.numberLong(); @@ -425,7 +425,8 @@ namespace mongo { currCount = 0; log() << "splitVector doing another cycle because of force, keyCount now: " << keyCount << endl; - c.reset( new BtreeCursor( d , d->idxNo(*idx) , *idx , min , max , false , 1 ) ); + bc = new BtreeCursor( d , d->idxNo(*idx) , *idx , min , max , false , 1 ); + c.reset( bc ); cc.reset( new ClientCursor( QueryOption_NoCursorTimeout , c , ns ) ); } @@ -442,6 +443,7 @@ namespace mongo { // Remove the sentinel at the beginning before returning and add fieldnames. splitKeys.erase( splitKeys.begin() ); + assert( c.get() ); for ( vector::iterator it = splitKeys.begin(); it != splitKeys.end() ; ++it ) { *it = bc->prettyKey( *it ); } -- cgit v1.2.3