Skip to content

Commit d6f97c5

Browse files
committed
fix getLastErrorDetailed definitions to match
1 parent f727f3b commit d6f97c5

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

client/dbclient.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,15 +305,16 @@ namespace mongo {
305305
b.append( "fsync", 1 );
306306
if ( j )
307307
b.append( "j", 1 );
308-
if ( wtimeout > 0 )
309-
b.append( "wtimeout", wtimeout );
310308

311309
// only affects request when greater than one node
312310
if ( w >= 1 )
313311
b.append( "w", w );
314312
else if ( w == -1 )
315313
b.append( "w", "majority" );
316314

315+
if ( wtimeout > 0 )
316+
b.append( "wtimeout", wtimeout );
317+
317318
runCommand("admin", b.obj(), info);
318319

319320
return info;

client/dbclient.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,15 +472,15 @@ namespace mongo {
472472
/** Get error result from the last write operation (insert/update/delete) on this connection.
473473
@return error message text, or empty string if no error.
474474
*/
475-
string getLastError(bool fsync = false, bool j = false, int w = 1, int wtimeout = 0);
475+
string getLastError(bool fsync = false, bool j = false, int w = 0, int wtimeout = 0);
476476

477477
/** Get error result from the last write operation (insert/update/delete) on this connection.
478478
@return full error object.
479479
480480
If "w" is -1, wait for propagation to majority of nodes.
481481
If "wtimeout" is 0, the operation will block indefinitely if needed.
482482
*/
483-
virtual BSONObj getLastErrorDetailed(bool fsync = false, bool j = false, int w = 1, int wtimeout = 0);
483+
virtual BSONObj getLastErrorDetailed(bool fsync = false, bool j = false, int w = 0, int wtimeout = 0);
484484

485485
/** Can be called with the returned value from getLastErrorDetailed to extract an error string.
486486
If all you need is the string, just call getLastError() instead.

client/syncclusterconnection.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ namespace mongo {
135135
throw UserException( 8001 , (string)"SyncClusterConnection write op failed: " + err.str() );
136136
}
137137

138-
BSONObj SyncClusterConnection::getLastErrorDetailed() {
138+
BSONObj SyncClusterConnection::getLastErrorDetailed(bool fsync, bool j, int w, int wtimeout) {
139139
if ( _lastErrors.size() )
140140
return _lastErrors[0];
141-
return DBClientBase::getLastErrorDetailed();
141+
return DBClientBase::getLastErrorDetailed(fsync,j,w,wtimeout);
142142
}
143143

144144
void SyncClusterConnection::_connect( string host ) {

client/syncclusterconnection.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ namespace mongo {
8585
virtual bool isFailed() const { return false; }
8686
virtual string toString() { return _toString(); }
8787

88-
virtual BSONObj getLastErrorDetailed();
88+
virtual BSONObj getLastErrorDetailed(bool fsync=false, bool j=false, int w=0, int wtimeout=0);
8989

9090
virtual bool callRead( Message& toSend , Message& response );
9191

0 commit comments

Comments
 (0)