Skip to content

Commit

Permalink
adding FOUND_ROWS to the connect flags for mysql2
Browse files Browse the repository at this point in the history
  • Loading branch information
tenderlove committed Aug 20, 2010
1 parent 0c75ec5 commit 0420fb5
Showing 1 changed file with 5 additions and 0 deletions.
Expand Up @@ -6,6 +6,11 @@ module ActiveRecord
class Base
def self.mysql2_connection(config)
config[:username] = 'root' if config[:username].nil?

if Mysql2::Client.const_defined? :FOUND_ROWS
config[:flags] = Mysql2::Client::FOUND_ROWS
end

client = Mysql2::Client.new(config.symbolize_keys)
options = [config[:host], config[:username], config[:password], config[:database], config[:port], config[:socket], 0]
ConnectionAdapters::Mysql2Adapter.new(client, logger, options, config)
Expand Down

0 comments on commit 0420fb5

Please sign in to comment.