Skip to content

Commit

Permalink
Merge branch 'SERVER-5384'
Browse files Browse the repository at this point in the history
  • Loading branch information
renctan committed Apr 13, 2012
2 parents 769ca68 + 73cbee7 commit 5bac8e0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
24 changes: 24 additions & 0 deletions jstests/mr_noscripting.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
var conn = MongoRunner.runMongod({ noscripting: '' });
var testDB = conn.getDB( 'foo' );
var coll = testDB.bar;

coll.insert({ x: 1 });

var map = function() {
emit( this.x, 1 );
};

var reduce = function( key, values ) {
return 1;
};

var mrResult = testDB.runCommand({ mapReduce: 'bar', map: map, reduce: reduce,
out: { inline: 1 }});

assert.eq( 0, mrResult.ok, 'mr result: ' + tojson( mrResult ));

// Confirm that mongod did not crash
var cmdResult = testDB.adminCommand({ serverStatus: 1 });
assert( cmdResult.ok, 'serverStatus failed, result: ' +
tojson( cmdResult ));

2 changes: 2 additions & 0 deletions src/mongo/db/commands/mr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,8 @@ namespace mongo {

log(1) << "mr ns: " << config.ns << endl;

uassert( 16149 , "cannot run map reduce without the js engine", globalScriptEngine );

auto_ptr<ClientCursor> holdCursor;
ShardChunkManagerPtr chunkManager;

Expand Down

0 comments on commit 5bac8e0

Please sign in to comment.