From b2aaad779f163df3506b4362cf65fe6d3eb983f3 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Tue, 17 May 2022 14:54:58 -0300 Subject: [PATCH] PMM-9998 Fixed MariaDB in Debian detection --- utils/version/mysql.go | 2 ++ utils/version/mysql_test.go | 15 +++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/utils/version/mysql.go b/utils/version/mysql.go index 147e70c3a..d895259fa 100644 --- a/utils/version/mysql.go +++ b/utils/version/mysql.go @@ -48,6 +48,8 @@ func GetMySQLVersion(q *reform.Querier) (string, string, error) { vendor = "percona" case strings.Contains(strings.ToLower(ven), "mariadb"): vendor = "mariadb" + case strings.Contains(strings.ToLower(ven), "debian") && strings.Contains(strings.ToLower(ver), "mariadb"): + vendor = "mariadb" default: vendor = "oracle" } diff --git a/utils/version/mysql_test.go b/utils/version/mysql_test.go index 6c08b05b5..f9c94b72e 100644 --- a/utils/version/mysql_test.go +++ b/utils/version/mysql_test.go @@ -91,6 +91,21 @@ func TestGetMySQLVersion(t *testing.T) { wantVendor: "mariadb", wantVersion: "10.2", }, + { + name: "MariaDB-Debian", + mockedData: []mockedVariables{ + { + variable: "version", + value: "10.1.48-MariaDB-0+deb9u2", + }, + { + variable: "version_comment", + value: "Debian 9.13", + }, + }, + wantVendor: "mariadb", + wantVersion: "10.1", + }, } //nolint:paralleltest