Details
-
Bug
-
Resolution: Cannot Reproduce
-
Major - P3
-
None
-
2.1
-
None
-
None
Description
Creating a WriteConcern with a w value of 0 or -1 incorrectly sets getlasterror to 1 instead of 0.
The callGetLastError method correctly returns true only if w > 0.
It appears that this line in the constructor WriteConcern( int w , int wtimeout , boolean fsync):
_command = new BasicDBObject( "getlasterror" , 1 );
should be change to:
_command = new BasicDBObject( "getlasterror" , _w > 0 ? 1 : 0 );