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

New feature to remove all currently set user variables

Details

    Description

      I suggest a new feature which would remove all user variables from the current thread again.

      It seems currently the only way to achieve that is a new connection.

      Syntax suggestion: "RESET USER VARIABLES"

      Attachments

        Issue Links

          Activity

            This was implemented in 10.2.0 in the USER_VARIABLES plugin.

            But RESET part isn't documented, this needs to be fixed.

            serg Sergei Golubchik added a comment - This was implemented in 10.2.0 in the USER_VARIABLES plugin. But RESET part isn't documented, this needs to be fixed.
            greenman Ian Gilfillan added a comment -

            FLUSH USER_VARIABLES is what you are looking for, and this has now been documented in the appropriate locations.

            greenman Ian Gilfillan added a comment - FLUSH USER_VARIABLES is what you are looking for, and this has now been documented in the appropriate locations.
            warp Markus Peter added a comment -

            Thank you. Just a nitpick: Not sure it should be part of "FLUSH" though, as this requires RELOAD rights. Deleting user variables shouldn't need more rights than actually setting them, this is non-sensical:

            MariaDB [(none)]> set @foo=1;
            Query OK, 0 rows affected (0.000 sec)

            MariaDB [(none)]> flush user_variables;
            ERROR 1227 (42000): Access denied; you need (at least one of) the RELOAD privilege(s) for this operation

            warp Markus Peter added a comment - Thank you. Just a nitpick: Not sure it should be part of "FLUSH" though, as this requires RELOAD rights. Deleting user variables shouldn't need more rights than actually setting them, this is non-sensical: MariaDB [(none)] > set @foo=1; Query OK, 0 rows affected (0.000 sec) MariaDB [(none)] > flush user_variables; ERROR 1227 (42000): Access denied; you need (at least one of) the RELOAD privilege(s) for this operation

            You're right. To implement it we need to figure out how information_schema plugins can define what privileges FLUSH should require

            serg Sergei Golubchik added a comment - You're right. To implement it we need to figure out how information_schema plugins can define what privileges FLUSH should require

            People

              greenman Ian Gilfillan
              warp Markus Peter
              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.