SERVER-2864 allow generating a query pattern when there is an invalid range for a field

This commit is contained in:
Aaron
2011-09-12 22:51:36 -07:00
parent 5410320e7c
commit 9cc4038d7e
6 changed files with 69 additions and 29 deletions

View File

@@ -266,11 +266,14 @@ doneCheckOrder:
}
void QueryPlan::registerSelf( long long nScanned ) const {
// FIXME SERVER-2864 Otherwise no query pattern can be generated.
if ( _frs.matchPossible() ) {
SimpleMutex::scoped_lock lk(NamespaceDetailsTransient::_qcMutex);
NamespaceDetailsTransient::get_inlock( ns() ).registerIndexForPattern( _frs.pattern( _order ), indexKey(), nScanned );
// Impossible query constraints can be detected before scanning, and we
// don't have a reserved pattern enum value for impossible constraints.
if ( _impossible ) {
return;
}
SimpleMutex::scoped_lock lk(NamespaceDetailsTransient::_qcMutex);
NamespaceDetailsTransient::get_inlock( ns() ).registerIndexForPattern( _frs.pattern( _order ), indexKey(), nScanned );
}
/**