mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-02-28 02:07:54 +08:00
Merge pull request #1062 from percona/PT-2220_pt-heartbeats_--check-read-only_option_behaves_strangely
PT-2220 - pt-heartbeat's --check-read-only option behaves strangely
This commit is contained in:
@@ -6793,8 +6793,8 @@ sub main {
|
||||
|
||||
sub server_is_readonly {
|
||||
my ($dbh) = @_;
|
||||
my ( $is_read_only ) = $dbh->selectrow_array(q{SELECT @@global.read_only});
|
||||
if ( $is_read_only ) {
|
||||
my ( $is_read_only, $is_super_read_only ) = $dbh->selectrow_array(q{SELECT @@global.read_only, @@global.super_read_only});
|
||||
if ( $is_read_only and not $is_super_read_only ) {
|
||||
my ( $privs ) = eval { $dbh->selectrow_array(q{SHOW GRANTS}) };
|
||||
if ( $privs && $privs =~ /\b(?:ALL|SUPER)\b/ ) {
|
||||
$is_read_only = undef;
|
||||
|
||||
Reference in New Issue
Block a user