diff options
Diffstat (limited to 'activerecord/lib/active_record')
4 files changed, 21 insertions, 21 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb index dde45b0ef3..f3e4601278 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb @@ -395,13 +395,13 @@ module ActiveRecord @transaction.number end - def create_savepoint + def create_savepoint(name = nil) end - def rollback_to_savepoint + def rollback_to_savepoint(name = nil) end - def release_savepoint + def release_savepoint(name = nil) end def case_sensitive_modifier(node) 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 d502daf230..a73a480003 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb @@ -340,16 +340,16 @@ module ActiveRecord # Transactions aren't supported end - def create_savepoint - execute("SAVEPOINT #{current_savepoint_name}") + def create_savepoint(name = current_savepoint_name) + execute("SAVEPOINT #{name}") end - def rollback_to_savepoint - execute("ROLLBACK TO SAVEPOINT #{current_savepoint_name}") + def rollback_to_savepoint(name = current_savepoint_name) + execute("ROLLBACK TO SAVEPOINT #{name}") end - def release_savepoint - execute("RELEASE SAVEPOINT #{current_savepoint_name}") + def release_savepoint(name = current_savepoint_name) + execute("RELEASE SAVEPOINT #{name}") end # In the simple case, MySQL allows us to place JOINs directly into the UPDATE diff --git a/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb b/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb index 85f645123e..d9838467cd 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql/database_statements.rb @@ -219,16 +219,16 @@ module ActiveRecord execute "ROLLBACK" end - def create_savepoint - execute("SAVEPOINT #{current_savepoint_name}") + def create_savepoint(name = current_savepoint_name) + execute("SAVEPOINT #{name}") end - def rollback_to_savepoint - execute("ROLLBACK TO SAVEPOINT #{current_savepoint_name}") + def rollback_to_savepoint(name = current_savepoint_name) + execute("ROLLBACK TO SAVEPOINT #{name}") end - def release_savepoint - execute("RELEASE SAVEPOINT #{current_savepoint_name}") + def release_savepoint(name = current_savepoint_name) + execute("RELEASE SAVEPOINT #{name}") end end end diff --git a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb index 136094dcc9..0863055caf 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb @@ -351,16 +351,16 @@ module ActiveRecord exec_query(sql, name).rows end - def create_savepoint - execute("SAVEPOINT #{current_savepoint_name}") + def create_savepoint(name = current_savepoint_name) + execute("SAVEPOINT #{name}") end - def rollback_to_savepoint - execute("ROLLBACK TO SAVEPOINT #{current_savepoint_name}") + def rollback_to_savepoint(name = current_savepoint_name) + execute("ROLLBACK TO SAVEPOINT #{name}") end - def release_savepoint - execute("RELEASE SAVEPOINT #{current_savepoint_name}") + def release_savepoint(name = current_savepoint_name) + execute("RELEASE SAVEPOINT #{name}") end def begin_db_transaction #:nodoc: |