Note
This variable is available starting with V4.1.0.
Description
cte_max_recursion_depth specifies the maximum recursion depth of a common table expression (CTE). The server terminates the execution of any CTE that exceeds this value.
Applicability
This variable is applicable only to OceanBase Database in MySQL-compatible mode.
Privilege requirements
Query variables
Global level
systenants and all user tenants can execute theSHOW VARIABLESstatement or query theinformation_schema.GLOBAL_VARIABLESview (MySQL-compatible mode) to view the value of a global system variable.Session level
systenants and all user tenants can execute theSHOW VARIABLESstatement or query theinformation_schema.SESSION_VARIABLESview (MySQL-compatible mode) to view the value of a session system variable.
Modify variables
Global level
systenants can directly modify the value of a global system variable.MySQL user tenants must have the
SUPERorALTER SYSTEMprivilege to modify the value of a global system variable.
Session level
systenants and all user tenants can directly modify the value of a session system variable.
Attributes
| Attribute | Description |
|---|---|
| Type | Uint |
| Default value | 1000 |
| Value range | [0, 4294967295] |
| Scope |
|
| Modifiable | Yes. You can execute the SET statement to modify the value. |
| Nullable | Yes |
Examples
Set the maximum recursion depth of a common table expression (CTE) to 1000.
Global level
obclient> SET GLOBAL cte_max_recursion_depth = 1000;Session level
obclient> SET cte_max_recursion_depth =1000;