mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-03 02:55:57 +00:00
Merge pull request #809 from percona/PT-2190_pt-show-grants_should_use_print_identified_with_as_hex
PT-2190 - pt-show-grants should use print_identified_with_as_hex
This commit is contained in:
@@ -2006,11 +2006,18 @@ sub main {
|
||||
# Roles can be identified because the user password is expired, the authentication
|
||||
# string is empty and the account is locked
|
||||
my $mysql8_where = '';
|
||||
if ($version !~ "-MariaDB" && VersionCompare::cmp($version, '8.0.0') >= 0) {
|
||||
if ( $version !~ "-MariaDB" && VersionCompare::cmp($version, '8.0.0') >= 0 ) {
|
||||
$mysql8_where = ' WHERE NOT ( `account_locked`="Y" AND ' .
|
||||
' `password_expired`="Y" AND ' .
|
||||
' `authentication_string`="" ) ';
|
||||
}
|
||||
|
||||
# PT-2190. Starting from 8.0.17 we will set print_identified_with_as_hex
|
||||
# before getting users
|
||||
if ( $version !~ "-MariaDB" && VersionCompare::cmp($version, '8.0.17') >= 0 ) {
|
||||
$dbh->do('SET print_identified_with_as_hex = 1');
|
||||
}
|
||||
|
||||
my $users = $o->get('only') || $dbh->selectall_arrayref(
|
||||
"SELECT DISTINCT User, Host FROM mysql.user $mysql8_where ORDER BY User, Host",
|
||||
{ Slice => {} });
|
||||
|
Reference in New Issue
Block a user