Description:
Quotes are used for information_schema.user_privileges.GRANTEE, but CURRENT_USER() and USER() return the name without quotes.
How to repeat:
This doesn't work:
select * from information_schema.user_privileges where PRIVILEGE_TYPE='SHOW VIEW' and GRANTEE=CURRENT_USER();
This does work, but is not optimal:
select * from information_schema.user_privileges where PRIVILEGE_TYPE='SHOW VIEW' and GRANTEE=CONCAT('\'',REPLACE(CURRENT_USER(),'@','\'@\''),'\'');
Suggested fix:
Add CURRENT_USER('QUOTED') or CURRENT_USER_QUOTED() or some other method to make it possible to match the GRANTEE column.
Description: Quotes are used for information_schema.user_privileges.GRANTEE, but CURRENT_USER() and USER() return the name without quotes. How to repeat: This doesn't work: select * from information_schema.user_privileges where PRIVILEGE_TYPE='SHOW VIEW' and GRANTEE=CURRENT_USER(); This does work, but is not optimal: select * from information_schema.user_privileges where PRIVILEGE_TYPE='SHOW VIEW' and GRANTEE=CONCAT('\'',REPLACE(CURRENT_USER(),'@','\'@\''),'\''); Suggested fix: Add CURRENT_USER('QUOTED') or CURRENT_USER_QUOTED() or some other method to make it possible to match the GRANTEE column.