From de6a01f29797eebe5381786ad07ae0f21a791b2a Mon Sep 17 00:00:00 2001 From: Aman Gupta Date: Wed, 27 Aug 2008 16:11:58 -0700 Subject: [PATCH] store references to IO objects to prevent "Bad file descriptor - (Errno::EBADF)" --- lib/mysqlplus.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mysqlplus.rb b/lib/mysqlplus.rb index 88b0e06..76bad4c 100644 --- a/lib/mysqlplus.rb +++ b/lib/mysqlplus.rb @@ -3,7 +3,7 @@ require 'mysql' class Mysql def async_query(sql) send_query(sql) - select([IO.new(socket)],nil,nil,nil) + select [ (@sockets ||= {})[socket] ||= IO.new(socket) ], nil, nil, nil get_result end end