From b1ba183548f1ad5d67eb60c2c3a358a577d0d88b Mon Sep 17 00:00:00 2001 From: Aidan Haran Date: Tue, 11 Feb 2025 10:58:52 +0000 Subject: [PATCH] Fix check --- test/cases/coerced_tests.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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