Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-5237

Minor inconsistency between current_role and I_S.enabled_roles

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      I suppose I_S.ENABLED_ROLES should return at least the same as CURRENT_ROLE, but in fact it's not always so.

      
      --error 0,ER_CANNOT_USER
      drop role r1;
      
      create role r1;
      set role r1;
      
      select current_role();
      select * from information_schema.enabled_roles;
      
      drop role r1;
      
      select current_role();
      select * from information_schema.enabled_roles;
      

      After the role is dropped, current_role() still returns the name of the dropped role, while I_S.enabled_roles contains NULL:

      drop role r1;
      select current_role();
      current_role()
      r1
      select * from information_schema.enabled_roles;
      ROLE_NAME
      NULL
      

      Since current_role behavior is the same as for current_user (if the user is dropped, current_user for an open session still returns the name), I guess I_S.enabled_roles should do the same.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

              Hide
              elenst Elena Stepanova added a comment -

              As discussed, it works the same way for current_user vs I_S.user_privileges, so it can be considered either not a bug at all, or something not worth fixing. Closing as such.

              Show
              elenst Elena Stepanova added a comment - As discussed, it works the same way for current_user vs I_S.user_privileges, so it can be considered either not a bug at all, or something not worth fixing. Closing as such.

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  elenst Elena Stepanova
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: