Skip to content

Commit

Permalink
SERVER-1159 match array with null
Browse files Browse the repository at this point in the history
  • Loading branch information
astaple committed Jul 8, 2010
1 parent cca87c3 commit 74b3619
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions db/matcher.cpp
Expand Up @@ -50,7 +50,9 @@ namespace {
#define DEBUGMATCHER(x)

namespace mongo {


extern BSONObj staticNull;

class Where {
public:
Where() {
Expand Down Expand Up @@ -739,7 +741,7 @@ namespace mongo {
return false;
if ( cmp == 0 ) {
/* missing is ok iff we were looking for null */
if ( m.type() == jstNULL || m.type() == Undefined ) {
if ( m.type() == jstNULL || m.type() == Undefined || ( bm.compareOp == BSONObj::opIN && bm.myset->count( staticNull.firstElement() ) > 0 ) ) {
if ( ( bm.compareOp == BSONObj::NE ) ^ bm.isNot ) {
return false;
}
Expand Down

0 comments on commit 74b3619

Please sign in to comment.