Skip to content

Commit

Permalink
Merge branch 'master' of github.com:mongodb/mongo
Browse files Browse the repository at this point in the history
  • Loading branch information
astaple committed Feb 17, 2010
2 parents 081795e + 6039189 commit 1c55567
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -5,6 +5,7 @@

*~
*.o
*.os
*.obj
*.aps
*.ilk
Expand Down
7 changes: 7 additions & 0 deletions SConstruct
Expand Up @@ -249,6 +249,11 @@ AddOption("--nostrip",
action="store_true",
help="do not strip installed binaries")

AddOption("--sharedclient",
dest="sharedclient",
action="store",
help="build a libmongoclient.so/.dll")

# --- environment setup ---

def removeIfInList( lst , thing ):
Expand Down Expand Up @@ -1091,6 +1096,8 @@ mongos = env.Program( "mongos" , commonFiles + coreDbFiles + coreServerFiles + s

# c++ library
clientLibName = str( env.Library( "mongoclient" , allClientFiles )[0] )
if GetOption( "sharedclient" ):
sharedClientLibName = str( env.SharedLibrary( "mongoclient" , allClientFiles )[0] )
env.Library( "mongotestfiles" , commonFiles + coreDbFiles + serverOnlyFiles + ["client/gridfs.cpp"])

clientTests = []
Expand Down
30 changes: 30 additions & 0 deletions dbtests/querytests.cpp
Expand Up @@ -285,6 +285,35 @@ namespace QueryTests {
}
};

class TailableQueryOnId : public ClientBase {
public:
~TailableQueryOnId() {
client().dropCollection( "unittests.querytests.TailableQueryOnId" );
}
void run() {
const char *ns = "unittests.querytests.TailableQueryOnId";
insert( ns, BSON( "a" << 0 ) );
insert( ns, BSON( "a" << 1 ) );
auto_ptr< DBClientCursor > c1 = client().query( ns, QUERY( "a" << GT << -1 ), 0, 0, 0, QueryOption_CursorTailable );
OID id;
id.init("000000000000000000000000");
auto_ptr< DBClientCursor > c2 = client().query( ns, QUERY( "_id" << GT << id ), 0, 0, 0, QueryOption_CursorTailable );
c1->next();
c1->next();
ASSERT( !c1->more() );
c2->next();
c2->next();
ASSERT( !c2->more() );
insert( ns, BSON( "a" << 2 ) );
ASSERT( c1->more() );
ASSERT_EQUALS( 2, c1->next().getIntField( "a" ) );
ASSERT( !c1->more() );
// ASSERT( c2->more() ); // SERVER-645
// ASSERT_EQUALS( 2, c2->next().getIntField( "a" ) ); // SERVER-645
ASSERT( !c2->more() );
}
};

class OplogReplayMode : public ClientBase {
public:
~OplogReplayMode() {
Expand Down Expand Up @@ -953,6 +982,7 @@ namespace QueryTests {
add< EmptyTail >();
add< TailableDelete >();
add< TailableInsertDelete >();
add< TailableQueryOnId >();
add< OplogReplayMode >();
add< ArrayId >();
add< UnderscoreNs >();
Expand Down

0 comments on commit 1c55567

Please sign in to comment.