Skip to content

Commit 0faa0a7

Browse files
committed
Test for iterating twice with :cache_rows => false
1 parent e58d027 commit 0faa0a7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

spec/mysql2/result_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@
8282
expect(result.first.object_id).not_to eql(result.first.object_id)
8383
end
8484

85+
it "should be able to iterate a second time even if cache_rows is disabled" do
86+
result = @client.query "SELECT 1 UNION SELECT 2", :cache_rows => false
87+
expect(result.to_a).to eql(result.to_a)
88+
end
89+
8590
it "should yield different value for #first if streaming" do
8691
result = @client.query "SELECT 1 UNION SELECT 2", :stream => true, :cache_rows => false
8792
expect(result.first).not_to eql(result.first)

0 commit comments

Comments
 (0)