why do grants switch from granular to ALL after granting "lock tables"

We have a role with all these permissions.

GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON db.* to rolea

As soon as i grant ‘lock tables’ to the role it no longer displays individual roles after executing show grants. It now simply says grant all privs

GRANT ALL PRIVILEGES ON db.* to rolea

Any idea why?

±----------+

| @@version |

±----------+

| 8.0.21-12 |

±----------+

I imagine this is a simple code check within core mysql. If you have all the flags then display ‘ALL’ otherwise show them individually. Have you tried using pt-show-grants instead? I believe this tool will show you all individual flags.