-
Type:
Bug
-
Resolution: Cannot Reproduce
-
Priority:
Major - P3
-
None
-
Affects Version/s: 2.1
-
Component/s: None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
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 );