summaryrefslogtreecommitdiff
path: root/db/commands
diff options
context:
space:
mode:
Diffstat (limited to 'db/commands')
-rw-r--r--db/commands/distinct.cpp2
-rw-r--r--db/commands/mr.cpp13
2 files changed, 13 insertions, 2 deletions
diff --git a/db/commands/distinct.cpp b/db/commands/distinct.cpp
index 2e26bcd..7b2f6a8 100644
--- a/db/commands/distinct.cpp
+++ b/db/commands/distinct.cpp
@@ -109,7 +109,7 @@ namespace mongo {
int now = bb.len();
- uassert(10044, "distinct too big, 4mb cap", ( now + e.size() + 1024 ) < bufSize );
+ uassert(10044, "distinct too big, 16mb cap", ( now + e.size() + 1024 ) < bufSize );
arr.append( e );
BSONElement x( start + now );
diff --git a/db/commands/mr.cpp b/db/commands/mr.cpp
index 16c604a..b9f5b59 100644
--- a/db/commands/mr.cpp
+++ b/db/commands/mr.cpp
@@ -758,7 +758,18 @@ namespace mongo {
BSONObj fast_emit( const BSONObj& args ) {
uassert( 10077 , "fast_emit takes 2 args" , args.nFields() == 2 );
uassert( 13069 , "an emit can't be more than half max bson size" , args.objsize() < ( BSONObjMaxUserSize / 2 ) );
- (*_tl)->emit( args );
+
+ if ( args.firstElement().type() == Undefined ) {
+ BSONObjBuilder b( args.objsize() );
+ b.appendNull( "" );
+ BSONObjIterator i( args );
+ i.next();
+ b.append( i.next() );
+ (*_tl)->emit( b.obj() );
+ }
+ else {
+ (*_tl)->emit( args );
+ }
return BSONObj();
}