Skip to content
This repository was archived by the owner on Mar 26, 2024. It is now read-only.

Commit 66dba82

Browse files
committed
Test for iterating twice with :cache_rows => false
1 parent aa74392 commit 66dba82

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
@@ -78,6 +78,11 @@
7878
result.first.object_id.should_not eql(result.first.object_id)
7979
end
8080

81+
it "should be able to iterate a second time even if cache_rows is disabled" do
82+
result = @client.query "SELECT 1 UNION SELECT 2", :cache_rows => false
83+
result.to_a.should eql(result.to_a)
84+
end
85+
8186
it "should yield different value for #first if streaming" do
8287
result = @client.query "SELECT 1 UNION SELECT 2", :stream => true, :cache_rows => false
8388
result.first.should_not eql(result.first)

0 commit comments

Comments
 (0)