incorrect output pt-show-grants for mysql roles

Description

pt-show-grants output for users based on MySQL roles could not be played on MySQL server.

How to reproduce:

 

I have created Role, User, and attach the role to user. Everything looks fine from the user perspective.

 

 

 

Try to drop the user and recreate it from pt-show grants output:

 

 

 

The problem is in 'DEFAULT ROLE `test`@`%`. If I remove it no problem with restoring the user, but till I execute 'set default role....' user can't work.

 

Checked on Percona server with pt-tool versions:

 

As I understand from official MySQL docs (https://dev.mysql.com/doc/refman/8.0/en/alter-user.html#alter-user-role) `alter user default role` command should be execute separately from other changes, and probably after roles granted to user.

 

 

Environment

None

Smart Checklist

Activity

Show:

Lalit Choudhary October 2, 2020 at 11:23 AM

Hi

Thank you for the report.

Validated as described with PS 8.0.20 and pt-toolkit 3.2.1

Details

Assignee

Reporter

Priority

Components

Affects versions

Fix versions

Smart Checklist

Created September 18, 2020 at 10:33 AM
Updated May 17, 2024 at 3:07 PM