diff --git a/bin/pt-stalk b/bin/pt-stalk index cc2df893..d04c888d 100755 --- a/bin/pt-stalk +++ b/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 diff --git a/lib/Sandbox.pm b/lib/Sandbox.pm index 3ee79ff4..6a21e7fa 100644 --- a/lib/Sandbox.pm +++ b/lib/Sandbox.pm @@ -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).