Skip to content

Commit 3431c87

Browse files
committed
Add a :cache_rows => false test for statements
1 parent e8001bb commit 3431c87

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

spec/mysql2/statement_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,14 @@
128128
expect(test_result['decimal_test']).to eql(123.45)
129129
end
130130

131+
it "should warn but still work if cache_rows is set to false" do
132+
@client.query_options.merge!(:cache_rows => false)
133+
statement = @client.prepare 'SELECT 1'
134+
result = nil
135+
expect { result = statement.execute.to_a }.to output(/:cache_rows is forced for prepared statements/).to_stderr
136+
expect(result.length).to eq(1)
137+
end
138+
131139
context "utf8_db" do
132140
before(:each) do
133141
@client.query("DROP DATABASE IF EXISTS test_mysql2_stmt_utf8")

0 commit comments

Comments
 (0)