-
Notifications
You must be signed in to change notification settings - Fork 796
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#1580) Add support for MariaDB 11.x
From MariaDB 11.x, mysql* names are deprecated (cf. https://jira.mariadb.org/browse/MDEV-29582). Use mariadb* names instead, to set factors accordingly. Use these factors to return the proper client binary. Co-authored-by: Sylvain Luce <[email protected]> Co-authored-by: Nicolas Le Gaillart <[email protected]>
- Loading branch information
1 parent
c0c8aee
commit 7398ffb
Showing
5 changed files
with
52 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
# frozen_string_literal: true | ||
|
||
Facter.add('mysql_version') do | ||
confine { Facter::Core::Execution.which('mysql') } | ||
setcode do | ||
mysql_ver = Facter::Core::Execution.execute('mysql --version') | ||
mysql_ver = if Facter::Core::Execution.which('mysql') | ||
Facter::Core::Execution.execute('mysql --version') | ||
elsif Facter::Core::Execution.which('mariadb') | ||
Facter::Core::Execution.execute('mariadb --version') | ||
end | ||
mysql_ver.match(%r{\d+\.\d+\.\d+})[0] if mysql_ver | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
Facter.add('mysqld_version') do | ||
confine { Facter::Core::Execution.which('mysqld') || Facter::Core::Execution.which('/usr/libexec/mysqld') } | ||
setcode do | ||
# Add /usr/libexec to PATH to find mysqld command | ||
Facter::Core::Execution.execute('env PATH=$PATH:/usr/libexec mysqld --no-defaults -V 2>/dev/null') | ||
if Facter::Core::Execution.which('mysqld') || Facter::Core::Execution.which('/usr/libexec/mysqld') | ||
Facter::Core::Execution.execute('env PATH=$PATH:/usr/libexec mysqld --no-defaults -V 2>/dev/null') | ||
elsif Facter::Core::Execution.which('mariadbd') | ||
Facter::Core::Execution.execute('mariadbd --no-defaults -V 2>/dev/null') | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters