diff options
author | Timothy Smith <timothy.smith@sun.com> | 2009-11-03 14:34:01 -0700 |
---|---|---|
committer | Timothy Smith <timothy.smith@sun.com> | 2009-11-03 14:34:01 -0700 |
commit | 345054c916672dcfb51492d68fc0d00eb999d430 (patch) | |
tree | d68c6f8e87bea820e084a3c88b1fe1940765abf0 /scripts | |
parent | e29b7ef5b8f663c04d7a40a575a6ff8c231c9433 (diff) | |
download | mariadb-git-345054c916672dcfb51492d68fc0d00eb999d430.tar.gz |
Add a few comments to clarify do_query() return values in mysql_secure_installation.pl
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/mysql_secure_installation.pl.in | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/mysql_secure_installation.pl.in b/scripts/mysql_secure_installation.pl.in index 255416763ef..25339f9b916 100755 --- a/scripts/mysql_secure_installation.pl.in +++ b/scripts/mysql_secure_installation.pl.in @@ -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); } |