From 0b3b63305e3e401c31f89966267bdc5e74bff329 Mon Sep 17 00:00:00 2001 From: Brian Lopez Date: Mon, 18 Oct 2010 12:15:16 -0700 Subject: [PATCH] only use wait_timeout if it's a Fixnum --- lib/active_record/connection_adapters/mysql2_adapter.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/active_record/connection_adapters/mysql2_adapter.rb b/lib/active_record/connection_adapters/mysql2_adapter.rb index a442fa8..c72c3c4 100644 --- a/lib/active_record/connection_adapters/mysql2_adapter.rb +++ b/lib/active_record/connection_adapters/mysql2_adapter.rb @@ -622,7 +622,8 @@ module ActiveRecord variable_assignments << "NAMES '#{encoding}'" if encoding # increase timeout so mysql server doesn't disconnect us - variable_assignments << "@@wait_timeout = #{@config[:wait_timeout] || 2592000}" + wait_timeout = @config[:wait_timeout] || 2592000 + variable_assignments << "@@wait_timeout = #{wait_timeout}" if wait_timeout.is_a?(Fixnum) execute("SET #{variable_assignments.join(', ')}", :skip_logging) end