Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

SERVER-4778 make combinatorial result set limits consistent

  • Loading branch information...
commit 97c194fc3d3ab1773d4a6edc8c0fa540a154a62f 1 parent 5750a5b
@astaple astaple authored
Showing with 5 additions and 4 deletions.
  1. +2 −2 jstests/in7.js
  2. +3 −2 src/mongo/db/queryutil.cpp
View
4 jstests/in7.js
@@ -1,6 +1,6 @@
t = db.jstests_slow_in1;
t.drop();
-t.ensureIndex( {a:1,b:1,c:1,d:1,e:1,f:1} );
+t.ensureIndex( {a:1,b:1,c:1,d:1,e:1,f:1,g:1} );
i = {$in:[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 ]};
-assert.throws.automsg( function() { t.count( {a:i,b:i,c:i,d:i,e:i,f:i} ); } );
+assert.throws.automsg( function() { t.count( {a:i,b:i,c:i,d:i,e:i,f:i,g:i} ); } );
View
5 src/mongo/db/queryutil.cpp
@@ -27,6 +27,8 @@
#include "../util/mongoutils/str.h"
namespace mongo {
+ static const unsigned maxCombinations = 4000000;
+
extern BSONObj staticNull;
extern BSONObj staticUndefined;
@@ -963,7 +965,7 @@ namespace mongo {
assert( !_ranges.back().empty() );
}
uassert( 13385, "combinatorial limit of $in partitioning of result set exceeded",
- size() < 1000000 );
+ size() < maxCombinations );
}
BSONObj FieldRangeVector::startKey() const {
@@ -1071,7 +1073,6 @@ namespace mongo {
BSONObj first = i->first->obj();
BSONObj second = i->second->obj();
- const unsigned maxCombinations = 4000000;
if ( forward ) {
for( vector<FieldInterval>::const_iterator j = intervals.begin(); j != intervals.end(); ++j ) {
uassert( 13303, "combinatorial limit of $in partitioning of result set exceeded", newBuilders.size() < maxCombinations );
Please sign in to comment.
Something went wrong with that request. Please try again.