SERVER-109 handle dynamically removed or clauses when iterating clauses

This commit is contained in:
Aaron
2010-06-08 15:55:34 -07:00
parent 05c5af2b40
commit 5be4d78fba
3 changed files with 10 additions and 8 deletions

View File

@@ -600,11 +600,9 @@ namespace mongo {
if ( !_or ) {
auto_ptr< FieldRangeSet > frs( new FieldRangeSet( ns, _query ) );
_currentQps.reset( new QueryPlanSet( ns, frs, _query, order, hint, honorRecordedPlan, min, max ) );
_n = 1; // only one run
} else {
BSONElement e = _query.getField( "$or" );
massert( 13268, "invalid $or spec", e.type() == Array && e.embeddedObject().nFields() > 0 );
_n = e.embeddedObject().nFields();
}
}
@@ -614,11 +612,9 @@ namespace mongo {
++_i;
return _currentQps->runOp( op );
}
if ( _i != 0 ) {
_fros.popOrClause();
}
++_i;
auto_ptr< FieldRangeSet > frs( _fros.topFrs() );
_fros.popOrClause();
_currentQps.reset( new QueryPlanSet( _ns, frs, _query, BSONObj(), 0, _honorRecordedPlan ) );
shared_ptr< QueryOp > ret( _currentQps->runOp( op ) );
return ret;