Permalink
Browse files

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
  • Loading branch information...
1 parent e47c838 commit 75d0623b3d1a71be2c63099cdeca48df5e3d4331 @jeremy jeremy committed Nov 28, 2005
Showing with 7 additions and 1 deletion.
  1. +2 −0 activerecord/CHANGELOG
  2. +5 −1 activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
View
@@ -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 @@ def quoted_false
# 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

0 comments on commit 75d0623

Please sign in to comment.