only use wait_timeout if it's a Fixnum

This commit is contained in:
Brian Lopez 2010-10-18 12:15:16 -07:00
parent 47405ae1f0
commit 0b3b63305e
1 changed files with 2 additions and 1 deletions

View File

@ -622,7 +622,8 @@ module ActiveRecord
variable_assignments << "NAMES '#{encoding}'" if encoding variable_assignments << "NAMES '#{encoding}'" if encoding
# increase timeout so mysql server doesn't disconnect us # 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) execute("SET #{variable_assignments.join(', ')}", :skip_logging)
end end