diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/test_helper.rb | 4 | ||||
-rw-r--r-- | test/unit/issue_nested_set_concurrency_test.rb | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/test/test_helper.rb b/test/test_helper.rb index c5fe079c8..19fa1ca4f 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -203,6 +203,10 @@ class ActiveSupport::TestCase Redmine::Database.mysql? end + def mysql8? + Gem::Version.new(Redmine::Database.mysql_version) >= Gem::Version.new('8.0.0') + end + def postgresql? Redmine::Database.postgresql? end diff --git a/test/unit/issue_nested_set_concurrency_test.rb b/test/unit/issue_nested_set_concurrency_test.rb index 0f330bcc8..7f45a4b8d 100644 --- a/test/unit/issue_nested_set_concurrency_test.rb +++ b/test/unit/issue_nested_set_concurrency_test.rb @@ -32,7 +32,7 @@ class IssueNestedSetConcurrencyTest < ActiveSupport::TestCase skip if sqlite? if mysql? connection = ActiveRecord::Base.connection_db_config.configuration_hash.deep_dup - connection[:variables] = { transaction_isolation: "READ-COMMITTED" } + connection[:variables] = mysql8? ? { transaction_isolation: "READ-COMMITTED" } : { tx_isolation: "READ-COMMITTED" } ActiveRecord::Base.establish_connection connection end User.current = nil |