From 1d74d12f513669d38216ea00e5c614a054da5d22 Mon Sep 17 00:00:00 2001 From: David Barbion Date: Mon, 30 Mar 2026 14:44:27 +0200 Subject: [PATCH] (acceptance-test-pr-1705) fix: install mysql 8.4 without error Co-authored-by: David Barbion --- lib/puppet/provider/mysql.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/puppet/provider/mysql.rb b/lib/puppet/provider/mysql.rb index 55e088df2..a53c72716 100644 --- a/lib/puppet/provider/mysql.rb +++ b/lib/puppet/provider/mysql.rb @@ -86,8 +86,16 @@ def mysqld_type def self.mysqld_version_string # As the possibility of the mysqld being remote we need to allow the version string to be overridden, # this can be done by facter.value as seen below. In the case that it has not been set and the facter - # value is nil we use an empty string so that default client/service are used. - @mysqld_version_string ||= Facter.value(:mysqld_version) || '' + # value is nil we use the mariadbd or mysql command to ensure we report the correct version of engine + # for later use cases. + @mysqld_version_string ||= Facter.value(:mysqld_version) || version_raw + end + + def self.version_raw + # get either version of mariadb or mysql + `mariadbd -V` + rescue + `mysqld -V` end def mysqld_version_string