diff --git a/10.1/root/usr/share/container-scripts/mysql/common.sh b/10.1/root/usr/share/container-scripts/mysql/common.sh index 7f985662..f9f7fb9a 100644 --- a/10.1/root/usr/share/container-scripts/mysql/common.sh +++ b/10.1/root/usr/share/container-scripts/mysql/common.sh @@ -173,7 +173,7 @@ function wait_for_mysql_master() { # Converts string version to the integer format (5.5.33 is converted to 505, # 10.1.23-MariaDB is converted into 1001, etc. function version2number() { - local version_major=${1%.*} + local version_major=$(echo "$1" | grep -o -e '^[0-9]*\.[0-9]*') printf %d%02d ${version_major%%.*} ${version_major##*.} } @@ -184,8 +184,7 @@ function mysqld_version() { # Returns version from the daemon in integer format function mysqld_compat_version() { - local compat_version=$(mysqld_version) - echo $(version2number $(mysqld_version)) + version2number $(mysqld_version) } # Returns version from the datadir