    # File lib/active_record/connection_adapters/mysql_adapter.rb, line 262
          def active?
            if @connection.respond_to?(:stat)
              @connection.stat
            else
              @connection.query 'select 1'
            end

            # mysql-ruby doesn't raise an exception when stat fails.
            if @connection.respond_to?(:errno)
              @connection.errno.zero?
            else
              true
            end
          rescue Mysql::Error
            false
          end