Skip to content
This repository has been archived by the owner on Oct 29, 2023. It is now read-only.

Commit

Permalink
Fix issue #80 NDB tarballs wrongly labeled
Browse files Browse the repository at this point in the history
NDB tarballs were wrongly labeled as regular "mysql" flavor.
Now they are labeled correctly
  • Loading branch information
datacharmer committed May 25, 2019
1 parent e8216d7 commit 8d2836b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .build/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.30.0
1.30.1
3 changes: 3 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
1.30.1 22-May-2019
BUGS FIXED
- Fix issue #80 NDB tarballs are wrongly labeled as regular "mysql" flavor
1.30.0 05-May-2019
BUGS FIXED
- Fix Issue #72 Catalog operations can clash with multiple dbdeployer runs
Expand Down
17 changes: 15 additions & 2 deletions cmd/unpack.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ import (
"regexp"
"strings"

"github.com/spf13/cobra"

"github.com/datacharmer/dbdeployer/common"
"github.com/datacharmer/dbdeployer/globals"
"github.com/datacharmer/dbdeployer/unpack"
"github.com/spf13/cobra"
)

// Tries to detect the database flavor from tarball name
Expand All @@ -40,7 +41,19 @@ func detectTarballFlavor(tarballName string) string {
common.MySQLFlavor: `mysql`,
}

for key, value := range flavorsRegexps {
// Flavors must be evaluated in order, or else
// "mysql-cluster" may be detected as "mysql"
flavorDetectionList := []string{
common.PerconaServerFlavor,
common.MariaDbFlavor,
common.NdbFlavor,
common.TiDbFlavor,
common.PxcFlavor,
common.MySQLFlavor,
}

for _, key := range flavorDetectionList {
value := flavorsRegexps[key]
re := regexp.MustCompile(value)
if re.MatchString(tarballName) {
return key
Expand Down
4 changes: 2 additions & 2 deletions common/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
package common

// This file was generated during build. Do not edit.
// Build time: 2019-05-05 05:18
// Build time: 2019-05-22 20:50

var VersionDef string = "1.30.0" // 2019-05-05
var VersionDef string = "1.30.1" // 2019-05-22

// Compatible version is the version used to mark compatible archives (templates, configuration).
// It is usually major.minor.0, except when we are at version 0.x, when
Expand Down

0 comments on commit 8d2836b

Please sign in to comment.