From f61b2c0799db59e34d9d2d52dfae6ee3a375b0aa Mon Sep 17 00:00:00 2001 From: Aaron Date: Tue, 19 May 2009 11:48:56 -0400 Subject: [PATCH] do checkLocation before testing refLoc in clientcursor, to remove warning message --- db/clientcursor.cpp | 4 ++-- jstests/capped4.js | 2 ++ 2 files changed, 4 insertions(+), 2 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 );