Note
- For OceanBase Database V4.3.x, this variable was introduced in OceanBase Database V4.3.2.
- For OceanBase Database V4.2.x, this variable was introduced in OceanBase Database V4.2.3.
Description
ob_compatibility_control specifies the compatible MySQL version in the case of a product behavior conflict. Valid values are MYSQL5.7 and MYSQL8.0. If you set this parameter to MYSQL5.7, MySQL 8.0-based features without behavior conflicts will not be affected. You can specify the compatible version when you create a tenant. It cannot be modified after the tenant is created.
Applicability
This variable is applicable to only OceanBase Database in MySQL mode.
Limitations
In the sys tenant or a user tenant, you can execute the SHOW VARIABLES statement to query the variable at the global level or query the information_schema.GLOBAL_VARIABLES view (in MySQL mode) for the variable at the global level.
Attributes
| Attribute | Description |
|---|---|
| Type | ENUM |
| Default value | MYSQL5.7 |
| Value range | MYSQL5.7 and MYSQL8.0 |
| Effective scope | Global |
| Modifiable | No. You can set the variable when you create a tenant. After the tenant is created, you cannot modify the variable by executing the SET or ALTER SESSION SET statement. |
| Read-only | Yes |
Considerations
When you upgrade a tenant without this variable to a version with this variable, this variable is set to
MYSQL5.7by default. When you create a tenant, you can specify a value for this variable.If the OceanBase Database version specified by
ob_compatibility_versionis earlier than V4.2.3, existing MySQL 8.0-based features are compatible with MySQL 8.0 regardless of the value ofob_compatibility_control.
Examples
Set the compatible MySQL version to 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='%';