Note
This variable is available starting with V4.2.2.
Description
automatic_sp_privileges specifies whether to automatically grant the ALTER and EXECUTE privileges to the creator of a stored procedure.
Applicability
This variable applies only to OceanBase Database in MySQL mode.
Privilege requirements
Query variables
systenants and all user tenants can execute theSHOW VARIABLESstatement or query theinformation_schema.GLOBAL_VARIABLESview (MySQL mode) to view the value of global system variables.Modify variables
systenants can directly modify the value of global system variables.MySQL user tenants need to have the
SUPERorALTER SYSTEMprivilege to modify the value of global system variables.
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
Grant the ALTER and EXECUTE privileges to the creator of a stored procedure.
obclient> SET GLOBAL automatic_sp_privileges = true;