Note
- For OceanBase Database V4.3.x, this variable was introduced in OceanBase Database V4.3.1.
- For OceanBase Database V4.2.x, this variable was introduced in OceanBase Database V4.2.2.
Description
The automatic_sp_privileges variable specifies whether to automatically grant 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
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or view theinformation_schema.GLOBAL_VARIABLESview (MySQL mode) to query the values of global system variables.Modify variables
The
systenant can directly modify the values of global system variables.MySQL user tenants must have the
SUPERorALTER SYSTEMprivilege to modify the values of global system variables.
Attributes
| Attribute | Description |
|---|---|
| Type | int |
| Default value | 1 |
| Valid values | [0,1] |
| Scope | Global |
| Modifiable | Yes. You can modify the value by using the SET statement. |
Considerations
When the value of this variable is 1 when a stored procedure is created, the creator is automatically granted ALTER and EXECUTE privileges on the stored procedure. If the value is 0, the creator is not granted these privileges.
Examples
Set the value of this variable to 1 to automatically grant ALTER and EXECUTE privileges to the creator of a stored procedure.
obclient> SET GLOBAL automatic_sp_privileges = true;
References
For information about the privileges of stored function, query the mysql.procs_priv view.