summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2019-02-21 16:54:31 +0100
committerSergei Golubchik <serg@mariadb.org>2019-02-21 16:54:31 +0100
commit33b9f80595d3dad74bd16e8ac430a93aecf8eddf (patch)
tree64901e7561c7fb1eab8f502be40191898cb0a653
parent7c8e17b9312e15f3352e3a4a65962c09fcf29c21 (diff)
downloadmariadb-git-33b9f80595d3dad74bd16e8ac430a93aecf8eddf.tar.gz
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
-rw-r--r--scripts/mysql_install_db.sh10
1 files changed, 5 insertions, 5 deletions
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;"