mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-08 10:18:26 +00:00
Added --ask-pass option to pt-stalk. Fixed small issue with sandbox when there is no mysql database
This commit is contained in:
16
bin/pt-stalk
16
bin/pt-stalk
@@ -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
|
||||
|
@@ -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).
|
||||
|
Reference in New Issue
Block a user