diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2005-11-28 21:00:03 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2005-11-28 21:00:03 +0000 |
commit | 75d0623b3d1a71be2c63099cdeca48df5e3d4331 (patch) | |
tree | c91d757b398035b185d7c7db844bb20981c6ba8b | |
parent | e47c8381e127fe36aa20f8343e46d065045a6445 (diff) | |
download | rails-75d0623b3d1a71be2c63099cdeca48df5e3d4331.tar.gz rails-75d0623b3d1a71be2c63099cdeca48df5e3d4331.tar.bz2 rails-75d0623b3d1a71be2c63099cdeca48df5e3d4331.zip |
MySQL: active? compatibility with the pure-Ruby driver. References #428.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3194 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | activerecord/CHANGELOG | 2 | ||||
-rwxr-xr-x | activerecord/lib/active_record/connection_adapters/mysql_adapter.rb | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index 3d635fbf62..ea60758a3f 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* MySQL: active? compatibility with the pure-Ruby driver. #428 [Jeremy Kemper] + * Oracle: active? check pings the database rather than testing the last command status. #428 [Michael Schoen] * SQLServer: resolve column aliasing/quoting collision when using limit or offset in an eager find. #2974 [kajism@yahoo.com] diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb index 76ea6e6530..c43a84a386 100755 --- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb @@ -150,7 +150,11 @@ module ActiveRecord # CONNECTION MANAGEMENT ==================================== def active? - @connection.stat if @connection.respond_to?(:stat) + if @connection.respond_to?(:stat) + @connection.stat + else + @connection.query 'select 1' + end true rescue Mysql::Error false |