diff options
Diffstat (limited to 'activerecord')
-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 |