Skip to content
This repository has been archived by the owner on Aug 24, 2022. It is now read-only.

PMM-9998 Fixed MariaDB in Debian detection #386

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions utils/version/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
15 changes: 15 additions & 0 deletions utils/version/mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down