diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2015-10-20 14:02:23 -0600 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2015-10-20 14:02:23 -0600 |
commit | 72fba7db413561cf293178d5df0708c9380356fb (patch) | |
tree | 8a38fef3f866800edbe9a110d460410ca3ed9c77 /activerecord/lib | |
parent | ee865eb244c8db11dcfbadbce0994d3c6488e7ec (diff) | |
parent | d39b6f77fc75790b1b2b3c5201bb037645d01483 (diff) | |
download | rails-72fba7db413561cf293178d5df0708c9380356fb.tar.gz rails-72fba7db413561cf293178d5df0708c9380356fb.tar.bz2 rails-72fba7db413561cf293178d5df0708c9380356fb.zip |
Merge pull request #21932 from kamipo/add_stored_procedure_test_in_mysql2
Add stored procedure test in mysql2
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb | 8 | ||||
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb index e9365cf8d0..e139092659 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -168,6 +168,10 @@ module ActiveRecord end end + def version + @version ||= Version.new(full_version.match(/^\d+\.\d+\.\d+/)[0]) + end + # Returns true, since this connection adapter supports migrations. def supports_migrations? true @@ -931,10 +935,6 @@ module ActiveRecord subselect.from subsubselect.distinct.as('__active_record_temp') end - def version - @version ||= Version.new(full_version.match(/^\d+\.\d+\.\d+/)[0]) - end - def mariadb? full_version =~ /mariadb/i end diff --git a/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb index 4461722bb4..6d5f31c6ca 100644 --- a/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb @@ -126,7 +126,9 @@ module ActiveRecord # Returns an array of arrays containing the field values. # Order is the same as that returned by +columns+. def select_rows(sql, name = nil, binds = []) - execute(sql, name).to_a + result = execute(sql, name) + @connection.next_result while @connection.more_results? + result.to_a end # Executes the SQL statement in the context of this connection. @@ -142,6 +144,7 @@ module ActiveRecord def exec_query(sql, name = 'SQL', binds = []) result = execute(sql, name) + @connection.next_result while @connection.more_results? ActiveRecord::Result.new(result.fields, result.to_a) end |