Note
- This variable is available starting with OceanBase Database V4.3.2 in the V4.3.x series.
- This variable is available starting with OceanBase Database V4.2.3 in the V4.2.x series.
Description
ob_compatibility_control specifies the compatibility mode when there is a compatibility conflict between MySQL 5.7 and MySQL 8.0. If you set ob_compatibility_control to MYSQL5.7, you can still use MySQL 8.0 features that do not have compatibility conflicts. You can specify the compatibility mode when you create a tenant. After the tenant is created, you cannot modify the compatibility mode.
Applicability
This variable applies only to the MySQL mode of OceanBase Database.
Privilege requirements
Query variables
The
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theinformation_schema.GLOBAL_VARIABLESview (MySQL mode) to view the values of global system variables.Modify variables
After a tenant is created, you cannot modify this variable by executing an SQL statement.
Attributes
| Attribute | Description |
|---|---|
| Parameter type | Enum |
| Default value | MYSQL5.7 |
| Value range | ["MYSQL5.7","MYSQL8.0"] |
| Scope | Global |
| Modifiable | No. You can specify this variable only when you create a tenant. After the tenant is created, you cannot modify the value by executing the SET or ALTER SESSION SET statement. |
| Read-only | Yes |
Usage notes
When you upgrade a tenant that does not have this variable to a version that has this variable, the variable takes the default value
MYSQL5.7. When you create a new tenant, you can specify the compatibility mode.For features that are implemented in MySQL 8.0 in earlier versions, if
ob_compatibility_version < 4.2.3, the features are compatible with MySQL 8.0 regardless of the value ofob_compatibility_control.
Examples
Specify the compatibility mode as MySQL 5.7 when you create a tenant.
obclient> create tenant tenant_m57 zone_list=('z1'),primary_zone='z1',resource_pool_list=('pool1') set ob_compatibility_mode='mysql',ob_compatibility_control='MYSQL5.7',ob_tcp_invited_nodes='%';
