From 33b9f80595d3dad74bd16e8ac430a93aecf8eddf Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Thu, 21 Feb 2019 16:54:31 +0100 Subject: mysql_install_db: make sure the variable's value is visible move the assignment out of a function, so that it wouldn't happen in a subshell --- scripts/mysql_install_db.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts/mysql_install_db.sh') diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 34f27ad5614..59607d7f508 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -515,15 +515,15 @@ mysqld_install_cmd_line() --net_buffer_length=16K } +# Use $auth_root_socket_user if explicitly specified. +# Otherwise use the owner of datadir - ${user:-$USER} +# Use 'root' as a fallback +auth_root_socket_user=${auth_root_socket_user:-${user:-${USER:-root}}} + cat_sql() { echo "use mysql;" - # Use $auth_root_socket_user if explicitly specified. - # Otherwise use the owner of datadir - ${user:-$USER} - # Use 'root' as a fallback - auth_root_socket_user=${auth_root_socket_user:-${user:-${USER:-root}}} - case "$auth_root_authentication_method" in normal) echo "SET @auth_root_socket=NULL;" -- cgit v1.2.1