mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-03-02 02:05:24 +08:00
fix problems with regex matching and PROXY grant in MySQL 5.5
This commit is contained in:
@@ -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" }
|
||||
|
||||
Reference in New Issue
Block a user