Note
- This variable is available starting with V4.3.2 in V4.3.x.
- This variable is available starting with V4.2.3 in V4.2.x.
Description
ob_compatibility_control specifies the behavior when there is a compatibility conflict between MySQL 5.7 and MySQL 8.0. If you set ob_compatibility_control to MYSQL5.7, MySQL 8.0 features that do not conflict with MySQL 5.7 are not affected. You can specify the compatibility mode when you create a tenant. After a tenant is created, you cannot modify the compatibility mode.
Applicability
This variable is available only in the MySQL-compatible mode of OceanBase Database.
Privilege requirements
Query variables
The
systenant and all user tenants can query the value of a global system variable by using theSHOW VARIABLESstatement or theinformation_schema.GLOBAL_VARIABLESview (MySQL-compatible mode).Modify variables
After a tenant is created, you cannot modify the value of 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 the compatibility mode only when you create a tenant. After a tenant is created, you cannot modify the compatibility mode 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 value of this variable is
MYSQL5.7by default. When you create a new tenant, you can specify the compatibility mode.For features implemented in MySQL 8.0 in earlier versions, if
ob_compatibility_versionis earlier than 4.2.3, these 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='%';