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:
Sveta Smirnova
2026-02-16 17:05:18 +03:00
committed by GitHub
2 changed files with 125 additions and 2 deletions

View File

@@ -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;