#!/usr/bin/env ruby
require 'mysql2'
require 'sequel'
CONF = {
adapter: 'mysql2',
encoding: 'utf8',
username: 'ruby',
password: 'ruby',
host: 'localhost',
port: 3306,
pool: 4,
read_timeout: 10,
write_timeout: 10,
connect_timeout: 10,
pool_timeout: 10,
database: 'demo',
max_conns: 7
}
conn = Sequel.connect(CONF)
t = Thread.new { conn['select sleep(100)'].all }
sleep 2
t.kill
sleep 15
When I run this code, I expect then select sleep(100) will stop after 10
seconds. But It does not.
When view mysql process list with:
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE COMMAND != 'Sleep'
>> See screen shot.
How to change my code to get expected result?
--
You received this message because you are subscribed to the Google Groups
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.