RUBY-180 fixed failing test
This commit is contained in:
parent
d0e97a2863
commit
3a4134a5c2
|
@ -363,12 +363,12 @@ module Mongo
|
||||||
BSON::BSON_RUBY.serialize_cstr(message, "#{@db.name}.#{@collection.name}")
|
BSON::BSON_RUBY.serialize_cstr(message, "#{@db.name}.#{@collection.name}")
|
||||||
|
|
||||||
# Number of results to return.
|
# Number of results to return.
|
||||||
if @limit
|
if @limit > 0
|
||||||
if (@returned + @batch_size) > @limit
|
limit = @limit - @returned
|
||||||
message.put_int(@limit - @returned)
|
if @batch_size > 0
|
||||||
else
|
limit = limit < @batch_size ? limit : @batch_size
|
||||||
message.put_int(@batch_size)
|
|
||||||
end
|
end
|
||||||
|
message.put_int(limit)
|
||||||
else
|
else
|
||||||
message.put_int(@batch_size)
|
message.put_int(@batch_size)
|
||||||
end
|
end
|
||||||
|
@ -438,7 +438,7 @@ module Mongo
|
||||||
end
|
end
|
||||||
|
|
||||||
def close_cursor_if_query_complete
|
def close_cursor_if_query_complete
|
||||||
if @limit > 0 && @n_received >= @limit
|
if @limit > 0 && @returned >= @limit
|
||||||
close
|
close
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue