Skip to content

Commit 9ce9de8

Browse files
authored
Fix regex to extract MySQL version correctly (#7774)
1 parent ac3f969 commit 9ce9de8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

misc/tools.func

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1322,7 +1322,7 @@ function setup_mysql() {
13221322
CURRENT_OS="$(awk -F= '/^ID=/{print $2}' /etc/os-release)"
13231323

13241324
if command -v mysql >/dev/null; then
1325-
CURRENT_VERSION="$(mysql --version | grep -oP 'Distrib\s+\K[0-9]+\.[0-9]+')"
1325+
CURRENT_VERSION="$(mysql --version | grep -oP '[0-9]+\.[0-9]+' | head -n1)"
13261326
if [[ "$CURRENT_VERSION" != "$MYSQL_VERSION" ]]; then
13271327
$STD msg_info "MySQL $CURRENT_VERSION will be upgraded to $MYSQL_VERSION"
13281328
NEED_INSTALL=true

0 commit comments

Comments
 (0)