diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-13 12:00:28 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-10-26 13:44:09 -0700 |
commit | efc10a8a64d5748bc8355c0bd0373ca6b8c8755c (patch) | |
tree | aad6999839ba57b2fb04d4bd4ccaaa1b2203138f /activerecord/lib/active_record | |
parent | 050d7d3e4979c88e8df46b69e6953599c09f6c18 (diff) | |
download | rails-efc10a8a64d5748bc8355c0bd0373ca6b8c8755c.tar.gz rails-efc10a8a64d5748bc8355c0bd0373ca6b8c8755c.tar.bz2 rails-efc10a8a64d5748bc8355c0bd0373ca6b8c8755c.zip |
eliminating some calls to execute()
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/mysql_adapter.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb index 1c32f64d92..6236a906c3 100644 --- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb @@ -307,10 +307,7 @@ module ActiveRecord def select_rows(sql, name = nil) @connection.query_with_result = true - result = execute(sql, name) - rows = [] - result.each { |row| rows << row } - result.free + rows = exec_without_stmt(sql, name).rows @connection.more_results && @connection.next_result # invoking stored procedures with CLIENT_MULTI_RESULTS requires this to tidy up else connection will be dropped rows end @@ -389,7 +386,7 @@ module ActiveRecord end def begin_db_transaction #:nodoc: - execute "BEGIN" + exec_without_stmt "BEGIN" rescue Exception # Transactions aren't supported end |