Commit 345054c9 authored by Timothy Smith's avatar Timothy Smith

Add a few comments to clarify do_query() return values in mysql_secure_installation.pl

parent e29b7ef5
...@@ -129,7 +129,11 @@ sub do_query { ...@@ -129,7 +129,11 @@ sub do_query {
my $query = shift; my $query = shift;
write_file($command, $query); write_file($command, $query);
my $rv = system("$mysql --defaults-file=$config < $command"); my $rv = system("$mysql --defaults-file=$config < $command");
# system() returns -1 if exec fails (e.g., command not found, etc.); die
# in this case because nothing is going to work
die "Failed to execute mysql client '$mysql'\n" if $rv == -1; die "Failed to execute mysql client '$mysql'\n" if $rv == -1;
# Return true if query executed OK, or false if there was some problem
# (for example, SQL error or wrong password)
return ($rv == 0 ? 1 : undef); return ($rv == 0 ? 1 : undef);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment