Skip to content

Instantly share code, notes, and snippets.

@jdelStrother
Created December 2, 2013 09:22
Show Gist options
  • Select an option

  • Save jdelStrother/7747010 to your computer and use it in GitHub Desktop.

Select an option

Save jdelStrother/7747010 to your computer and use it in GitHub Desktop.
require 'mysql2'
require 'fast_stack'
client = Mysql2::Client.new(:host => "localhost", :username => "root")
query = "SELECT * FROM information_schema.COLUMNS LIMIT 58"
# '58' is something of a magic number for this query. Any less, and the bug doesn't show up. At 58 or greater, I get:
# "Lost connection to MySQL server during query (Mysql2::Error)"
# The bug goes away if you comment out the FastStack.profile{} line.
FastStack.profile{
res = client.query(query)
puts "Got #{res.to_a.length} rows"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment