func (v *version) GetMinor() int {
	return v.minor
}
GetMinor returns minor
package mysql
import (
	"errors"
	"fmt"
	"strconv"
	"strings"
	"github.com/romberli/go-util/constant"
)
const (
	defaultSeparator     = "."
	mysqlVersionSliceLen = 3
)
type Version interface {
	GetMajor() int
	GetMinor() int
	GetRelease() int
	String() string
}
type version struct {
	major   int
	minor   int
	release int
}
func NewVersion(major, minor, release int) Version {
	return &version{
		major,
		minor,
		release,
	}
}
func Parse(v string) (Version, error) {
	return parse(v)
}
func parse(v string) (*version, error) {
	vSlice := strings.Split(v, "-")
	versionSlice := strings.Split(vSlice[constant.ZeroInt], defaultSeparator)
	if len(versionSlice) > mysqlVersionSliceLen {
		return nil, errors.New(fmt.Sprintf("%s is not a valid mysql version string.", v))
	}
	ver := &version{}
	for i, vStr := range versionSlice {
		vInt, err := strconv.Atoi(vStr)
		if err != nil {
			return nil, err
		}
		switch i {
		case 0:
			ver.major = vInt
		case 1:
			ver.minor = vInt
		case 2:
			ver.release = vInt
		}
	}
	return ver, nil
}
func (v *version) GetMajor() int {
	return v.major
}