Added --ask-pass option to pt-stalk. Fixed small issue with sandbox when there is no mysql database

This commit is contained in:
Frank Cizmich
2014-09-10 12:23:04 -03:00
parent f0a0a8f737
commit 8521e49415
2 changed files with 20 additions and 0 deletions

View File

@@ -1447,9 +1447,19 @@ if [ "${0##*/}" = "$TOOL" ] \
exit 0
fi
# if ASK-PASS , request password on terminal without echoing. This will override --password
if [ -n "$OPT_ASK_PASS" ]; then
stty_orig=`stty -g` # save original terminal setting.
echo -n "enter password: ";
stty -echo # turn-off echoing.
read OPT_PASSWORD # read the password
stty $stty_orig # restore terminal setting.
fi
MYSQL_ARGS="$(mysql_options)"
EXT_ARGV="$(arrange_mysql_options "$EXT_ARGV $MYSQL_ARGS")"
# Check that mysql and mysqladmin are in PATH. If not, we're
# already dead in the water, so don't bother with cmd line opts,
# just error and exit.
@@ -1650,6 +1660,12 @@ fail to start.
=over
=item --ask-pass
This option will prompt user for MySQL password once. Password is not echoed
on terminal.
This options overrides C<--password>
=item --collect
default: yes; negatable: yes

View File

@@ -374,6 +374,10 @@ sub verify_test_data {
. join(", ", map { "mysql.$_" } @tables_in_mysql)
. ", "
. join(", ", map { "sakila.$_" } @tables_in_sakila);
# remove leading "," if any
$sql =~ s/CHECKSUM TABLES\s+,/CHECKSUM TABLES /;
my @checksums = @{$dbh->selectall_arrayref($sql, {Slice => {} })};
# Diff the two sets of checksums: host to master (ref).