aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-09-11 05:43:46 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-09-11 05:43:46 +0000
commit04594cfadbfffceb087e1151f8b81255108d5211 (patch)
treee20ddad3b066a320fa4ec4cffc80f846af3f0dbe /activerecord/lib
parent8aa63a78b8ac238dd379108a5cb2cc5cc5418a40 (diff)
downloadrails-04594cfadbfffceb087e1151f8b81255108d5211.tar.gz
rails-04594cfadbfffceb087e1151f8b81255108d5211.tar.bz2
rails-04594cfadbfffceb087e1151f8b81255108d5211.zip
Fixed "connection lost" issue with the bundled Ruby/MySQL driver (would kill the app after 8 hours of inactivity) #2163, #428 [kajism@yahoo.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2182 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/vendor/mysql.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/vendor/mysql.rb b/activerecord/lib/active_record/vendor/mysql.rb
index 84f5d2533c..39ceb607b0 100644
--- a/activerecord/lib/active_record/vendor/mysql.rb
+++ b/activerecord/lib/active_record/vendor/mysql.rb
@@ -1022,6 +1022,9 @@ class Mysql
end
@sock.sync = true
buf.join
+ rescue
+ errno = Error::CR_SERVER_LOST
+ raise Error::new(errno, Error::err(errno))
end
def write(data)
@@ -1039,6 +1042,9 @@ class Mysql
@pkt_nr = @pkt_nr + 1 & 0xff
@sock.sync = true
@sock.flush
+ rescue
+ errno = Error::CR_SERVER_LOST
+ raise Error::new(errno, Error::err(errno))
end
def close()