We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b26d642 commit c45f7c4Copy full SHA for c45f7c4
test/cases/coerced_tests.rb
@@ -2805,10 +2805,11 @@ def test_with_recursive_coerced
2805
2806
module ActiveRecord
2807
class AdapterConnectionTest < ActiveRecord::TestCase
2808
- # Original method defined for core adapters.
+ # Original method only handled the core adapters.
2809
undef_method :raw_transaction_open?
2810
def raw_transaction_open?(connection)
2811
- 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"]
2812
+ transaction_count > 0
2813
rescue
2814
false
2815
end
0 commit comments