diff options
author | Praveenkumar Hulakund <praveenkumar.hulakund@oracle.com> | 2014-01-31 09:19:12 +0530 |
---|---|---|
committer | Praveenkumar Hulakund <praveenkumar.hulakund@oracle.com> | 2014-01-31 09:19:12 +0530 |
commit | 1d9ae547f3e57e86619058b8eefe9cee813daef5 (patch) | |
tree | ca16c0d2cc7a9e5d809312949495419aec366619 /client | |
parent | bebb3427f2fb46d257a2530b791e8c5d28f933ee (diff) | |
download | mariadb-git-1d9ae547f3e57e86619058b8eefe9cee813daef5.tar.gz |
Bug#14117012 - CHILD PROCESS MYSQL UTILITIES PICKING UP LOCAL
CONFIG FILES CAUSES TEST
Utility as "mysql_upgrade" forks "mysql"/"mysqlcheck". Attaching
"mysql_upgrade" shows following calls after forking "mysql" or
"mysql_check" when configuration file information is passed as
first argument to "mysql_upgrade".
strace -f ./mysql_upgrade --defaults-file=../pdb/my.cnf --socket=../pdb/mysql.sock -f
[pid 6254] stat("/etc/my.cnf", 0x7fff8e772680) = -1 ENOENT (No such file or directory)
[pid 6254] stat("/etc/mysql/my.cnf", 0x7fff8e772680) = -1 ENOENT (No such file or directory)
[pid 6254] stat("/usr/local/mysql/etc/my.cnf", 0x7fff8e772680) = -1 ENOENT (No such file or directory)
[pid 6254] stat("/home/user_name/.my.cnf", {st_mode=S_IFREG|0664, st_size=19, ...}) = 0
[pid 6254] open("/home/user_name/.my.cnf", O_RDONLY) = 3
But when tool forks "mysqlcheck"/"mysql", "--no-defaults" is passed
as first argument. Before forking, in function "find_tool" of
"mysql_upgrade", check is made to verify whether tool can be
executable or not by calling "mysqlcheck --help" and "mysql --help".
But argument "--no-defaults", "--defaults-file" or
"defaults-extra-file" is not passed to "mysql" and "mysqlcheck".
So my.cnf is searched in default paths.
Fix:
------
Modified code to pass "--no-defaults" as first argument to "mysql"
and "mysqlcheck" while checking tool can be executed or not.
Diffstat (limited to 'client')
-rw-r--r-- | client/mysql_upgrade.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index c220ef16cfe..33f9f030c1e 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -462,6 +462,7 @@ static void find_tool(char *tool_executable_name, const char *tool_name, */ if (run_tool(tool_executable_name, &ds_tmp, /* Get output from command, discard*/ + "--no-defaults", "--help", "2>&1", IF_WIN("> NUL", "> /dev/null"), |