summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2009-05-19 11:54:40 -0400
committerEliot Horowitz <eliot@10gen.com>2009-05-19 11:54:40 -0400
commita97bf7dd78e4ae56e710cd51a84259bd065d881b (patch)
tree3fcd682c27c9c8e620b44fd9a5cd890c092b9653
parent3a75b466c8fc5bd6719f842a2952cceb413b0197 (diff)
parentf61b2c0799db59e34d9d2d52dfae6ee3a375b0aa (diff)
downloadmongo-a97bf7dd78e4ae56e710cd51a84259bd065d881b.tar.gz
Merge branch 'master' of git@github.com:mongodb/mongo
-rw-r--r--db/clientcursor.cpp4
-rw-r--r--jstests/capped4.js2
-rw-r--r--scripting/sm_db.cpp6
3 files changed, 7 insertions, 5 deletions
diff --git a/db/clientcursor.cpp b/db/clientcursor.cpp
index 85f21059ff9..85620a787f3 100644
--- a/db/clientcursor.cpp
+++ b/db/clientcursor.cpp
@@ -133,12 +133,12 @@ namespace mongo {
i != toAdvance.end(); ++i )
{
Cursor *c = (*i)->c.get();
+ c->checkLocation();
DiskLoc tmp1 = c->refLoc();
if ( tmp1 != dl ) {
/* this might indicate a failure to call ClientCursor::updateLocation() */
- problem() << "warning: cursor loc does not match byLoc position!" << endl;
+ problem() << "warning: cursor loc " << tmp1 << " does not match byLoc position " << dl << " !" << endl;
}
- c->checkLocation();
c->advance();
if ( c->eof() ) {
// advanced to end -- delete cursor
diff --git a/jstests/capped4.js b/jstests/capped4.js
index aa824bafe8a..9d4735b92f6 100644
--- a/jstests/capped4.js
+++ b/jstests/capped4.js
@@ -20,3 +20,5 @@ assert( !t.findOne( { i : 19 } ) );
assert( !c.hasNext() );
assert( !d.hasNext() );
assert( t.find().sort( { i : 1 } ).hint( { i : 1 } ).toArray().length > 10 );
+
+assert( t.validate().valid );
diff --git a/scripting/sm_db.cpp b/scripting/sm_db.cpp
index c46838882d2..0820022077f 100644
--- a/scripting/sm_db.cpp
+++ b/scripting/sm_db.cpp
@@ -39,14 +39,14 @@ namespace mongo {
class CursorHolder {
public:
CursorHolder( auto_ptr< DBClientCursor > &cursor, const shared_ptr< DBClientBase > &connection ) :
- cursor_( cursor ),
- connection_( connection ) {
+ connection_( connection ),
+ cursor_( cursor ) {
assert( cursor_.get() );
}
DBClientCursor *get() const { return cursor_.get(); }
private:
- auto_ptr< DBClientCursor > cursor_;
shared_ptr< DBClientBase > connection_;
+ auto_ptr< DBClientCursor > cursor_;
};
DBClientCursor *getCursor( JSContext *cx, JSObject *obj ) {