Merge lp:~percona-toolkit-dev/percona-toolkit/pt-stalk-handles-mysql-user-password-in-awkward-way-1348679 into lp:~percona-toolkit-dev/percona-toolkit/release-2.2.11

Proposed by Frank Cizmich
Status: Merged
Approved by: Daniel Nichter
Approved revision: 619
Merged at revision: 620
Proposed branch: lp:~percona-toolkit-dev/percona-toolkit/pt-stalk-handles-mysql-user-password-in-awkward-way-1348679
Merge into: lp:~percona-toolkit-dev/percona-toolkit/release-2.2.11
Diff against target: 49 lines (+18/-0)
2 files modified
bin/pt-stalk (+14/-0)
lib/Sandbox.pm (+4/-0)
To merge this branch: bzr merge lp:~percona-toolkit-dev/percona-toolkit/pt-stalk-handles-mysql-user-password-in-awkward-way-1348679
Reviewer Review Type Date Requested Status
Daniel Nichter Approve
Review via email: mp+234151@code.launchpad.net

Description of the change

Added --ask-pass for -pt-stalk , so passwords don't have to be submitted in clear text.

Also fixed a small unrelated issue in Sandbox.pm were an error was output when no database named mysql was present.

To post a comment you must log in.
Revision history for this message
Daniel Nichter (daniel-nichter) :
review: Needs Fixing
Revision history for this message
Daniel Nichter (daniel-nichter) wrote :

But otherwise the code changes are good. Since this is real difficult to test, please test it manually.

619. By Frank Cizmich

Changed password prompt message. Changed --ask-pass doc description

Revision history for this message
Daniel Nichter (daniel-nichter) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/pt-stalk'
2--- bin/pt-stalk 2014-08-05 20:37:42 +0000
3+++ bin/pt-stalk 2014-09-15 20:43:51 +0000
4@@ -1447,9 +1447,19 @@
5 exit 0
6 fi
7
8+ # if ASK-PASS , request password on terminal without echoing. This will override --password
9+ if [ -n "$OPT_ASK_PASS" ]; then
10+ stty_orig=`stty -g` # save original terminal setting.
11+ echo -n "Enter MySQL password: ";
12+ stty -echo # turn-off echoing.
13+ read OPT_PASSWORD # read the password
14+ stty $stty_orig # restore terminal setting.
15+ fi
16+
17 MYSQL_ARGS="$(mysql_options)"
18 EXT_ARGV="$(arrange_mysql_options "$EXT_ARGV $MYSQL_ARGS")"
19
20+
21 # Check that mysql and mysqladmin are in PATH. If not, we're
22 # already dead in the water, so don't bother with cmd line opts,
23 # just error and exit.
24@@ -1650,6 +1660,10 @@
25
26 =over
27
28+=item --ask-pass
29+
30+Prompt for a password when connecting to MySQL.
31+
32 =item --collect
33
34 default: yes; negatable: yes
35
36=== modified file 'lib/Sandbox.pm'
37--- lib/Sandbox.pm 2014-05-28 20:31:10 +0000
38+++ lib/Sandbox.pm 2014-09-15 20:43:51 +0000
39@@ -374,6 +374,10 @@
40 . join(", ", map { "mysql.$_" } @tables_in_mysql)
41 . ", "
42 . join(", ", map { "sakila.$_" } @tables_in_sakila);
43+
44+ # remove leading "," if any
45+ $sql =~ s/CHECKSUM TABLES\s+,/CHECKSUM TABLES /;
46+
47 my @checksums = @{$dbh->selectall_arrayref($sql, {Slice => {} })};
48
49 # Diff the two sets of checksums: host to master (ref).

Subscribers

People subscribed via source and target branches

to all changes: