diff options
author | Eliot Horowitz <eliot@10gen.com> | 2013-04-29 14:21:43 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2013-04-29 14:51:37 -0400 |
commit | 8d36f78e1b088f2a8741a58826969a70b8e296ba (patch) | |
tree | 0c78df408a85fe8a588ceb97575ca3e5bbd9ae97 /src/mongo/db/matcher.cpp | |
parent | b13db37280d9cfca51e1e5e59bf5956295ac61b6 (diff) | |
download | mongo-8d36f78e1b088f2a8741a58826969a70b8e296ba.tar.gz |
SERVER-6400 remove old unused code to make porting easier
Diffstat (limited to 'src/mongo/db/matcher.cpp')
-rw-r--r-- | src/mongo/db/matcher.cpp | 130 |
1 files changed, 0 insertions, 130 deletions
diff --git a/src/mongo/db/matcher.cpp b/src/mongo/db/matcher.cpp index ab0467d146d..b5ac3f71ae0 100644 --- a/src/mongo/db/matcher.cpp +++ b/src/mongo/db/matcher.cpp @@ -1023,136 +1023,6 @@ namespace mongo { return true; } -#ifdef MONGO_LATER_SERVER_4644 - void Matcher::visitReferences(FieldSink *pSink) const { - // check normal non-regex cases: - for ( unsigned i = 0; i < _basics.size(); i++ ) { - const ElementMatcher& bm = _basics[i]; - const BSONElement& m = bm._toMatch; - // -1=mismatch. 0=missing element. 1=match - int cmp = matchesDotted(m.fieldName(), m, jsobj, bm._compareOp, bm , false , details ); - if ( cmp == 0 && bm._compareOp == BSONObj::opEXISTS ) { - // If missing, match cmp is opposite of $exists spec. - cmp = -retExistsFound(bm); - } - if ( bm._isNot ) - cmp = -cmp; - if ( cmp < 0 ) - return false; - if ( cmp == 0 ) { - /* missing is ok iff we were looking for null */ - if ( m.type() == jstNULL || m.type() == Undefined || - ( ( bm._compareOp == BSONObj::opIN || bm._compareOp == BSONObj::NIN ) && bm._myset->count( staticNull.firstElement() ) > 0 ) ) { - if ( bm.negativeCompareOp() ^ bm._isNot ) { - return false; - } - } - else { - if ( !bm._isNot ) { - return false; - } - } - } - } - - for (vector<RegexMatcher>::const_iterator it = _regexs.begin(); - it != _regexs.end(); - ++it) { - BSONElementSet s; - if ( !_constrainIndexKey.isEmpty() ) { - BSONElement e = jsobj.getFieldUsingIndexNames(it->_fieldName, _constrainIndexKey); - - // Should only have keys nested one deep here, for geo-indices - // TODO: future indices may nest deeper? - if( e.type() == Array ){ - BSONObjIterator i( e.Obj() ); - while( i.more() ){ - s.insert( i.next() ); - } - } - else if ( !e.eoo() ) - s.insert( e ); - - } - else { - jsobj.getFieldsDotted( it->_fieldName, s ); - } - bool match = false; - for( BSONElementSet::const_iterator i = s.begin(); i != s.end(); ++i ) - if ( regexMatches(*it, *i) ) - match = true; - if ( !match ^ it->_isNot ) - return false; - } - - if ( _andMatchers.size() > 0 ) { - for( list< shared_ptr< Matcher > >::const_iterator i = _andMatchers.begin(); - i != _andMatchers.end(); ++i ) { - // SERVER-3192 Track field matched using details the same as for - // top level fields, at least for now. - if ( !(*i)->matches( jsobj, details ) ) { - return false; - } - } - } - - if ( _orMatchers.size() > 0 ) { - bool match = false; - for( list< shared_ptr< Matcher > >::const_iterator i = _orMatchers.begin(); - i != _orMatchers.end(); ++i ) { - // SERVER-205 don't submit details - we don't want to track field - // matched within $or - if ( (*i)->matches( jsobj ) ) { - match = true; - break; - } - } - if ( !match ) { - return false; - } - } - - if ( _norMatchers.size() > 0 ) { - for( list< shared_ptr< Matcher > >::const_iterator i = _norMatchers.begin(); - i != _norMatchers.end(); ++i ) { - // SERVER-205 don't submit details - we don't want to track field - // matched within $nor - if ( (*i)->matches( jsobj ) ) { - return false; - } - } - } - - if ( _where ) { - if ( _where->func == 0 ) { - u_assert( 10070 , "$where compile error", false); - return false; // didn't compile - } - - if ( _where->jsScope ) { - _where->scope->init( _where->jsScope ); - } - _where->scope->setObject( "obj", const_cast< BSONObj & >( jsobj ) ); - _where->scope->setBoolean( "fullObject" , true ); // this is a hack b/c fullObject used to be relevant - - int err = _where->scope->invoke( _where->func , 0, &jsobj , 1000 * 60 , false ); - if ( err == -3 ) { // INVOKE_ERROR - stringstream ss; - ss << "error on invocation of $where function:\n" - << _where->scope->getError(); - u_assert( 10071 , ss.str(), false); - return false; - } - else if ( err != 0 ) { // ! INVOKE_SUCCESS - u_assert( 10072 , "unknown error in invocation of $where function", false); - return false; - } - return _where->scope->getBoolean( "__returnValue" ) != 0; - - } - } -#endif /* MONGO_LATER_SERVER_4644 */ - static void visitList( MatcherVisitor& visitor, const list<shared_ptr<Matcher> >& matchers ) { for( list<shared_ptr<Matcher> >::const_iterator i = matchers.begin(); i != matchers.end(); |