Fix unit test failure related to initialization order of static variables

This commit is contained in:
Aaron Staple
2009-02-17 23:09:37 -05:00
parent 247d3e69a4
commit b30b8b3299
2 changed files with 9 additions and 3 deletions

View File

@@ -123,7 +123,12 @@ namespace mongo {
}
}
FieldBound FieldBoundSet::trivialBound_;
FieldBound *FieldBoundSet::trivialBound_ = 0;
FieldBound &FieldBoundSet::trivialBound() {
if ( trivialBound_ == 0 )
trivialBound_ = new FieldBound();
return *trivialBound_;
}
QueryPlan::QueryPlan( const FieldBoundSet &fbs, BSONObj order, BSONObj idxKey ) :
optimal_( false ),