diff options
-rw-r--r-- | db/commands/mr.cpp | 2 | ||||
-rw-r--r-- | jstests/sharding/bigMapReduce.js | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/db/commands/mr.cpp b/db/commands/mr.cpp index b9f5b59821c..17ff84a9431 100644 --- a/db/commands/mr.cpp +++ b/db/commands/mr.cpp @@ -508,7 +508,7 @@ namespace mongo { _scope->injectNative( "emit" , fast_emit ); - if ( _onDisk ) { + if ( _onDisk && _config.incLong != _config.tempLong ) { // clear temp collections _db.dropCollection( _config.tempLong ); _db.dropCollection( _config.incLong ); diff --git a/jstests/sharding/bigMapReduce.js b/jstests/sharding/bigMapReduce.js index 3cc1d66405a..b4a293b1d58 100644 --- a/jstests/sharding/bigMapReduce.js +++ b/jstests/sharding/bigMapReduce.js @@ -67,6 +67,10 @@ for (iter = 0; iter < 5; iter++) { print("checking result field"); assert.eq(res.result.collection, outCollStr, "Wrong collection " + res.result.collection); assert.eq(res.result.db, outDbStr, "Wrong db " + res.result.db); + + // make sure final collection has index on _id + assert(outDb.system.indexes.count({ns: outDbStr + "." + outCollStr, key: {_id: 1}}) > 0, "No index on _id") + assert( gotAGoodOne , "no good for out db" ) } assert( gotAGoodOne , "no good for out db" ) |