fix getLastErrorDetailed definitions to match
This commit is contained in:
@@ -305,8 +305,6 @@ namespace mongo {
|
||||
b.append( "fsync", 1 );
|
||||
if ( j )
|
||||
b.append( "j", 1 );
|
||||
if ( wtimeout > 0 )
|
||||
b.append( "wtimeout", wtimeout );
|
||||
|
||||
// only affects request when greater than one node
|
||||
if ( w >= 1 )
|
||||
@@ -314,6 +312,9 @@ namespace mongo {
|
||||
else if ( w == -1 )
|
||||
b.append( "w", "majority" );
|
||||
|
||||
if ( wtimeout > 0 )
|
||||
b.append( "wtimeout", wtimeout );
|
||||
|
||||
runCommand("admin", b.obj(), info);
|
||||
|
||||
return info;
|
||||
|
||||
@@ -472,7 +472,7 @@ namespace mongo {
|
||||
/** Get error result from the last write operation (insert/update/delete) on this connection.
|
||||
@return error message text, or empty string if no error.
|
||||
*/
|
||||
string getLastError(bool fsync = false, bool j = false, int w = 1, int wtimeout = 0);
|
||||
string getLastError(bool fsync = false, bool j = false, int w = 0, int wtimeout = 0);
|
||||
|
||||
/** Get error result from the last write operation (insert/update/delete) on this connection.
|
||||
@return full error object.
|
||||
@@ -480,7 +480,7 @@ namespace mongo {
|
||||
If "w" is -1, wait for propagation to majority of nodes.
|
||||
If "wtimeout" is 0, the operation will block indefinitely if needed.
|
||||
*/
|
||||
virtual BSONObj getLastErrorDetailed(bool fsync = false, bool j = false, int w = 1, int wtimeout = 0);
|
||||
virtual BSONObj getLastErrorDetailed(bool fsync = false, bool j = false, int w = 0, int wtimeout = 0);
|
||||
|
||||
/** Can be called with the returned value from getLastErrorDetailed to extract an error string.
|
||||
If all you need is the string, just call getLastError() instead.
|
||||
|
||||
@@ -135,10 +135,10 @@ namespace mongo {
|
||||
throw UserException( 8001 , (string)"SyncClusterConnection write op failed: " + err.str() );
|
||||
}
|
||||
|
||||
BSONObj SyncClusterConnection::getLastErrorDetailed() {
|
||||
BSONObj SyncClusterConnection::getLastErrorDetailed(bool fsync, bool j, int w, int wtimeout) {
|
||||
if ( _lastErrors.size() )
|
||||
return _lastErrors[0];
|
||||
return DBClientBase::getLastErrorDetailed();
|
||||
return DBClientBase::getLastErrorDetailed(fsync,j,w,wtimeout);
|
||||
}
|
||||
|
||||
void SyncClusterConnection::_connect( string host ) {
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace mongo {
|
||||
virtual bool isFailed() const { return false; }
|
||||
virtual string toString() { return _toString(); }
|
||||
|
||||
virtual BSONObj getLastErrorDetailed();
|
||||
virtual BSONObj getLastErrorDetailed(bool fsync=false, bool j=false, int w=0, int wtimeout=0);
|
||||
|
||||
virtual bool callRead( Message& toSend , Message& response );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user