Skip to content

Instantly share code, notes, and snippets.

@kamipo
Created October 10, 2015 12:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kamipo/a10047e0b6f5598e547a to your computer and use it in GitHub Desktop.
Save kamipo/a10047e0b6f5598e547a to your computer and use it in GitHub Desktop.
require 'mysql2'
client = Mysql2::Client.new(
host: 'localhost',
username: 'root',
database: 'mysql',
)
begin
num = 0
2000.times do |n|
num = n
stmt = client.prepare('SELECT * FROM user LIMIT 1')
stmt.execute
#stmt.close
#GC.start
end
rescue
p num
p $!
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment