adding FOUND_ROWS to the client flags
This commit is contained in:
parent
ce77899848
commit
c5f2eb7f3f
@ -6,6 +6,11 @@ module ActiveRecord
|
|||||||
class Base
|
class Base
|
||||||
def self.mysql2_connection(config)
|
def self.mysql2_connection(config)
|
||||||
config[:username] = 'root' if config[:username].nil?
|
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)
|
client = Mysql2::Client.new(config.symbolize_keys)
|
||||||
options = [config[:host], config[:username], config[:password], config[:database], config[:port], config[:socket], 0]
|
options = [config[:host], config[:username], config[:password], config[:database], config[:port], config[:socket], 0]
|
||||||
ConnectionAdapters::Mysql2Adapter.new(client, logger, options, config)
|
ConnectionAdapters::Mysql2Adapter.new(client, logger, options, config)
|
||||||
|
Loading…
Reference in New Issue
Block a user