mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 05:00:45 +00:00
Remove TableParser::check_table() privs check (re bug 1036747).
This commit is contained in:
@@ -5839,42 +5839,9 @@ sub check_table {
|
||||
return 0;
|
||||
}
|
||||
|
||||
PTDEBUG && _d('Table exists; no privs to check');
|
||||
return 1 unless $args{all_privs};
|
||||
|
||||
$sql = "SHOW FULL COLUMNS FROM $db_tbl";
|
||||
PTDEBUG && _d($sql);
|
||||
eval {
|
||||
$row = $dbh->selectrow_hashref($sql);
|
||||
};
|
||||
if ( $EVAL_ERROR ) {
|
||||
PTDEBUG && _d($EVAL_ERROR);
|
||||
return 0;
|
||||
}
|
||||
if ( !scalar keys %$row ) {
|
||||
PTDEBUG && _d('Table has no columns:', Dumper($row));
|
||||
return 0;
|
||||
}
|
||||
my $privs = $row->{privileges} || $row->{Privileges};
|
||||
|
||||
$sql = "DELETE FROM $db_tbl LIMIT 0";
|
||||
PTDEBUG && _d($sql);
|
||||
eval {
|
||||
$dbh->do($sql);
|
||||
};
|
||||
my $can_delete = $EVAL_ERROR ? 0 : 1;
|
||||
|
||||
PTDEBUG && _d('User privs on', $db_tbl, ':', $privs,
|
||||
($can_delete ? 'delete' : ''));
|
||||
|
||||
if ( !($privs =~ m/select/ && $privs =~ m/insert/ && $privs =~ m/update/
|
||||
&& $can_delete) ) {
|
||||
PTDEBUG && _d('User does not have all privs');
|
||||
return 0;
|
||||
}
|
||||
|
||||
PTDEBUG && _d('User has all privs');
|
||||
PTDEBUG && _d('Table', $db, $tbl, 'exists');
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
sub get_engine {
|
||||
|
Reference in New Issue
Block a user