Fix to test if database supports account locking correctly

This commit is contained in:
Ilia Ross
2025-08-13 21:20:25 +03:00
parent 9065de316a
commit 4c2fde6847

View File

@@ -1753,11 +1753,7 @@ return &unique(map { $_->{'file'} } @$conf);
sub get_account_lock_status
{
my ($user, $host) = @_;
my ($ver, $variant) = &get_remote_mysql_variant();
if (($variant eq "mariadb" && &compare_version_numbers($ver, "<", "10.2.0")) ||
($variant eq "mysql" && &compare_version_numbers($ver, "<", "5.7"))) {
return undef;
}
return undef if (!&get_account_lock_support());
my $rv = &execute_sql_safe($master_db, 'show create user ?@?', $user, $host);
return undef if (!ref($rv) || !@{$rv->{'data'}});
return $rv->{'data'}->[0][0] =~ /account\s+lock/i ? 1 : 0;