From 425449e98d0539e3fa4debb819283103cf27bce5 Mon Sep 17 00:00:00 2001 From: pavel Date: Sun, 15 Jul 2018 05:11:16 +0200 Subject: use set_server_option if possible --- activerecord/test/cases/fixtures_test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'activerecord/test/cases/fixtures_test.rb') diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb index 2ead2c4816..639627852d 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) -- cgit v1.2.3