Note
- This variable is available starting with V4.3.1 in the V4.3.x series.
- This variable is available starting with V4.2.2 in the V4.2.x series.
Description
automatic_sp_privileges specifies whether to grant ALTER and EXECUTE privileges to the creator of a stored procedure automatically.
Applicability
This variable applies only to OceanBase Database in MySQL mode.
Privilege requirements
Query variables
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theinformation_schema.GLOBAL_VARIABLESview (MySQL mode) to obtain the value of a global system variable.Modify variables
The
systenant can directly modify the value of a global system variable.A MySQL user tenant must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.
Attributes
| Attribute | Description |
|---|---|
| Type | int |
| Default value | 1 |
| Value range | [0, 1] |
| Scope | Global |
| Modifiable | Yes. You can execute the SET statement to modify the value. |
Usage
When the value of this variable is 1, the creator of a stored procedure is automatically granted the ALTER and EXECUTE privileges on the stored procedure. If the value is 0, the creator is not automatically granted these privileges.
Examples
Set the value of this variable to 1 to grant ALTER and EXECUTE privileges to the creator of a stored procedure automatically.
obclient> SET GLOBAL automatic_sp_privileges = true;
References
For information about the privileges of stored procedure functions, see the mysql.procs_priv view.
