2009-04-21 15:08:40 +00:00
|
|
|
# If this script returns without the word pass
|
|
|
|
# you may have compiled mysqlplus using ruby and
|
|
|
|
# run it using a different version of ruby
|
|
|
|
|
2009-04-21 02:13:24 +00:00
|
|
|
if RUBY_VERSION >= "1.9.1"
|
|
|
|
require 'mysqlplus'
|
|
|
|
require 'socket'
|
|
|
|
require 'timeout'
|
2009-04-21 15:08:40 +00:00
|
|
|
TCPServer.new '0.0.0.0', 8002
|
2009-04-21 02:17:44 +00:00
|
|
|
Thread.new {
|
|
|
|
sleep 2
|
|
|
|
print "pass"
|
|
|
|
system("kill -9 #{Process.pid}")
|
|
|
|
}
|
2009-04-21 02:13:24 +00:00
|
|
|
Timeout::timeout(1) {
|
|
|
|
# uncomment this line to do the 'real' test
|
|
|
|
# which hangs otherwise (blows up if code is bad, otherwise hangs)
|
2009-04-21 02:17:44 +00:00
|
|
|
Mysql.real_connect '127.0.0.1', 'root', 'pass', 'db', 8002
|
2009-04-21 02:13:24 +00:00
|
|
|
}
|
2009-04-21 15:08:40 +00:00
|
|
|
raise 'should never get here'
|
2009-04-21 02:13:24 +00:00
|
|
|
end
|
|
|
|
|