mirror of
https://github.com/github/rails.git
synced 2026-01-28 15:58:03 -05:00
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:
@@ -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]
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user