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

Dropped user's sessions are not killed automatically

    XMLWordPrintable

Details

    Description

      MariaDB allows you to drop a user while that user has active sessions. When the user is dropped, it can continue querying like nothing ever happened, even after flushing privileges:

      --user is logged in and can query tables
      MariaDB [mysql]> select count(*) from user;
      +----------+
      | count(*) |
      +----------+
      |       25 |
      +----------+
      1 row in set (0.00 sec)
       
      --user is then dropped by an admin
      MariaDB [mysql]> drop user user_to_be_dropped@localhost;
      Query OK, 0 rows affected (0.00 sec)
       
      --user can continue querying
      MariaDB [mysql]> select count(*) from user;
      +----------+
      | count(*) |
      +----------+
      |       24 |
      +----------+
      1 row in set (0.00 sec)
       
      --Even after flushing privileges
      MariaDB [mysql]> flush privileges;
      Query OK, 0 rows affected (0.00 sec)
       
      MariaDB [mysql]> select count(*) from user;
      +----------+
      | count(*) |
      +----------+
      |       24 |
      +----------+
      1 row in set (0.00 sec)
      

      I would expect user_to_be_dropped@localhost to get an error when running another query after the flush privileges.

      Is the above expected behaviour (meaning my expectations are wrong) or is this an actual bug?

      Attachments

        Activity

          People

            Unassigned Unassigned
            rpeiremans Robin Peiremans
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.