]> source.dussan.org Git - redmine.git/commitdiff
Extends mysql8? test helper to handle more complex version strings (#39865).
authorGo MAEDA <maeda@farend.jp>
Fri, 22 Dec 2023 00:06:29 +0000 (00:06 +0000)
committerGo MAEDA <maeda@farend.jp>
Fri, 22 Dec 2023 00:06:29 +0000 (00:06 +0000)
Patch by Jens Krämer.

git-svn-id: https://svn.redmine.org/redmine/trunk@22542 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/test_helper.rb

index 45fedd8e7583906eebbfc385b85c15477b198aa0..23ba199faa82c86442ae14f0e0f686854be604b0 100644 (file)
@@ -204,7 +204,8 @@ class ActiveSupport::TestCase
   end
 
   def mysql8?
-    Gem::Version.new(Redmine::Database.mysql_version) >= Gem::Version.new('8.0.0')
+    version = Redmine::Database.mysql_version.sub(/^(\d+\.\d+\.\d+).*/, '\1')
+    Gem::Version.new(version) >= Gem::Version.new('8.0.0')
   end
 
   def postgresql?