aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-04-29 09:27:19 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2011-04-29 11:09:37 -0700
commit00f030c6e107f92fc9ef13a8c77e31b5e5299e6e (patch)
tree36f1aa16802b74fff52dc40e347e1afcf5a42815 /activerecord
parented775c66bcf20dbc1de9654ace58c2d30e4d0427 (diff)
downloadrails-00f030c6e107f92fc9ef13a8c77e31b5e5299e6e.tar.gz
rails-00f030c6e107f92fc9ef13a8c77e31b5e5299e6e.tar.bz2
rails-00f030c6e107f92fc9ef13a8c77e31b5e5299e6e.zip
supporting delete with bind parameters in mysql2
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb
index cf68ddc2da..199bf7d494 100644
--- a/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/mysql2_adapter.rb
@@ -290,6 +290,14 @@ module ActiveRecord
execute sql.gsub('?') { quote(*binds.shift.reverse) }, name
end
+ def exec_delete(sql, name, binds)
+ binds = binds.dup
+
+ # Pretend to support bind parameters
+ execute sql.gsub('?') { quote(*binds.shift.reverse) }, name
+ @connection.affected_rows
+ end
+
def last_inserted_id(result)
@connection.last_id
end