[MDEV-25660] New feature to remove all currently set user variables Created: 2021-05-12  Updated: 2022-06-17  Resolved: 2022-05-30

Status: Closed
Project: MariaDB Server
Component/s: Documentation, Information Schema, Variables
Affects Version/s: N/A
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Markus Peter Assignee: Ian Gilfillan
Resolution: Fixed Votes: 0
Labels: feature_request

Issue Links:
PartOf
is part of MDEV-7331 information_schema.user_variables Closed

 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"



 Comments   
Comment by Sergei Golubchik [ 2022-05-20 ]

This was implemented in 10.2.0 in the USER_VARIABLES plugin.

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

Comment by Ian Gilfillan [ 2022-05-30 ]

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

Comment by Markus Peter [ 2022-05-31 ]

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

Comment by Sergei Golubchik [ 2022-06-17 ]

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

Generated at Thu Feb 08 09:39:23 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.