Skip to content

Commit ab39262

Browse files
committed
Test for memory errors by reusing a statement 1000 times
1 parent f512a77 commit ab39262

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
@@ -70,6 +70,14 @@
7070
@client.query 'DROP TABLE IF EXISTS mysql2_stmt_q'
7171
end
7272

73+
it "should be reusable 1000 times" do
74+
statement = @client.prepare 'SELECT 1'
75+
1000.times do
76+
result = statement.execute
77+
expect(result.to_a.length).to eq(1)
78+
end
79+
end
80+
7381
it "should be reusable 10000 times" do
7482
statement = @client.prepare 'SELECT 1'
7583
10000.times do

0 commit comments

Comments
 (0)