1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-29 05:21:33 +03:00

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

This commit is contained in:
Timothy Smith
2009-11-03 14:34:01 -07:00
parent 3aff1e9570
commit 3fbed5522a

View File

@ -129,7 +129,11 @@ sub do_query {
my $query = shift;
write_file($command, $query);
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;
# 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);
}