Skip to content

Commit f512a77

Browse files
committed
Test for memory errors by reusing a statement 10000 times
1 parent 00145dc commit f512a77

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 10000 times" do
74+
statement = @client.prepare 'SELECT 1'
75+
10000.times do
76+
result = statement.execute
77+
expect(result.to_a.length).to eq(1)
78+
end
79+
end
80+
7381
it "should select dates" do
7482
statement = @client.prepare 'SELECT NOW()'
7583
result = statement.execute

0 commit comments

Comments
 (0)