• Vicențiu Ciorbaru's avatar
    MDEV-29509 execute granted indirectly (via roles) doesn't always work · 16b2bb90
    Vicențiu Ciorbaru authored
    The issue manifests due to a bug in mysql_routine_grant. This was a side
    effect of e46eea86 which fixed the problem of not giving appropriate error
    message (ER_NONEXISTING_PROC_GRANT) when a routine grant existed due to role
    inheritance.
    
    When granting a routine privilege, it is possible to have a GRANT_NAME
    entry already created from an inherited role, but with it's init_privs
    set to 0.
    
    In this case we must not create a *new* grant entry, but we must edit
    this grant entry to set its init_privs.
    
    Note that this case was already covered by MDEV-29458, however due to a
    forgotten "flush privileges;" the actual code path never got hit.
    Remove the flush privilege command as it was never intended to be there
    in the first place.
    16b2bb90
role_grant_propagate-29458.result 4.15 KB