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
This commit is contained in:
Jeremy Kemper
2005-11-28 21:00:03 +00:00
parent e47c8381e1
commit 75d0623b3d
2 changed files with 7 additions and 1 deletions

View File

@@ -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]

View File

@@ -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