diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2018-07-18 16:53:52 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-18 16:53:52 -0400 |
commit | 371e3752948a324da70dc8fc8b0a2f2c66113112 (patch) | |
tree | b9e8f0eca80d7ca4081a34bac5dcb1852918610e /activerecord/test | |
parent | dc1c679d897281e92eef9f7540e540eb6334f94c (diff) | |
parent | 425449e98d0539e3fa4debb819283103cf27bce5 (diff) | |
download | rails-371e3752948a324da70dc8fc8b0a2f2c66113112.tar.gz rails-371e3752948a324da70dc8fc8b0a2f2c66113112.tar.bz2 rails-371e3752948a324da70dc8fc8b0a2f2c66113112.zip |
Merge pull request #33363 from ahorek/transaction_bug
use set_server_option if possible
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/fixtures_test.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb index c2a9cd2ea1..cdc9a8585f 100644 --- a/activerecord/test/cases/fixtures_test.rb +++ b/activerecord/test/cases/fixtures_test.rb @@ -114,6 +114,21 @@ class FixturesTest < ActiveRecord::TestCase end end end + + def test_bulk_insert_with_a_multi_statement_query_in_a_nested_transaction + fixtures = { + "traffic_lights" => [ + { "location" => "US", "state" => ["NY"], "long_state" => ["a"] }, + ] + } + + ActiveRecord::Base.transaction do + con = ActiveRecord::Base.connection + assert_equal 1, con.open_transactions + con.insert_fixtures_set(fixtures) + assert_equal 1, con.open_transactions + end + end end if current_adapter?(:Mysql2Adapter) |