diff --git a/test/cases/coerced_tests.rb b/test/cases/coerced_tests.rb index 0b30b7d3e..b9b511433 100644 --- a/test/cases/coerced_tests.rb +++ b/test/cases/coerced_tests.rb @@ -2805,10 +2805,11 @@ def test_with_recursive_coerced module ActiveRecord class AdapterConnectionTest < ActiveRecord::TestCase - # Original method defined for core adapters. + # Original method only handled the core adapters. undef_method :raw_transaction_open? def raw_transaction_open?(connection) - connection.instance_variable_get(:@raw_connection).query("SELECT @@trancount").to_a[0][0] > 0 + transaction_count = connection.instance_variable_get(:@raw_connection).execute("SELECT @@TRANCOUNT AS TRANSACTION_COUNT").first["TRANSACTION_COUNT"] + transaction_count > 0 rescue false end