From 45c85ba40dd75cdee02bc04aac523f907e341337 Mon Sep 17 00:00:00 2001 From: Baron Schwartz Date: Mon, 4 Jun 2012 00:05:05 -0400 Subject: [PATCH] fix problems with regex matching and PROXY grant in MySQL 5.5 --- bin/pt-show-grants | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/bin/pt-show-grants b/bin/pt-show-grants index 779c1eac..728de15d 100755 --- a/bin/pt-show-grants +++ b/bin/pt-show-grants @@ -1719,7 +1719,7 @@ sub main { if ( $o->get('separate') ) { # List each grant separately. @grants = map { - my ( $grants, $on_what ) = $_ =~ m/GRANT (.*?) ON ((?:`|\*).*)$/; + my ( $grants, $on_what ) = $_ =~ m/GRANT (.*?) ON (.*)$/; map { "GRANT $_ ON $on_what" } split(', ', $grants); } @grants; my $count; @@ -1753,16 +1753,10 @@ sub main { my $grant = $_; PTDEBUG && _d($grant); my ( $grants, $on_what, $user ) = $grant - =~ m/GRANT (.*?) ON ((?:`|\*).*?) TO ('[^']*'\@'[^']+')?/; + =~ m/GRANT (.*?) ON (.*?) TO ('[^']*'\@'[^']*')/; PTDEBUG && _d('grants:', $grants, 'on_what:', $on_what, 'user:', $user); - if ( !$user ) { - # Anonymous user: ''@'' (issue 445). - PTDEBUG && _d('Anonymous user'); - $user = "''\@''"; - } - my @result; if ( $o->get('separate') ) { @result = map { "REVOKE $_ ON $on_what FROM $user" }