Skip to content

Commit

Permalink
Make getting major version less fragile
Browse files Browse the repository at this point in the history
Remove unused variable compat_version
  • Loading branch information
hhorak committed Apr 27, 2017
1 parent ab2c6f0 commit f1a7915
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions 10.1/root/usr/share/container-scripts/mysql/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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##*.}
}

Expand All @@ -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
Expand Down

0 comments on commit f1a7915

Please sign in to comment.