diff options
author | Stephen Blackstone <sblackstone@gmail.com> | 2015-12-21 22:04:53 -0500 |
---|---|---|
committer | Stephen Blackstone <sblackstone@gmail.com> | 2015-12-22 02:47:29 -0500 |
commit | fdb0234434ae37885bf03b76319e8bee01b55071 (patch) | |
tree | 7089b0b4f13c934863efb71eeb8260a1916123a2 /activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb | |
parent | 17a4e450489a785af53d3e11f5a35ec1e8ea0903 (diff) | |
download | rails-fdb0234434ae37885bf03b76319e8bee01b55071.tar.gz rails-fdb0234434ae37885bf03b76319e8bee01b55071.tar.bz2 rails-fdb0234434ae37885bf03b76319e8bee01b55071.zip |
Add support for passing flags to MySQL2 adapter by array
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb index 6590e0140d..f4686b680c 100644 --- a/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb @@ -11,8 +11,13 @@ module ActiveRecord config[:username] = 'root' if config[:username].nil? config[:flags] ||= 0 + if Mysql2::Client.const_defined? :FOUND_ROWS - config[:flags] |= Mysql2::Client::FOUND_ROWS + if config[:flags].kind_of? Array + config[:flags].push "FOUND_ROWS".freeze + else + config[:flags] |= Mysql2::Client::FOUND_ROWS + end end client = Mysql2::Client.new(config) |