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
MySQL 5.7 and 8.0 behave differently in some scenarios. For example, REPLACE('abd','',null) returns different results in MySQL 5.7 and 8.0. ob_compatibility_control specifies whether to be compatible with MySQL 5.7 or MySQL 8.0 when a compatibility conflict occurs between MySQL 5.7 and MySQL 8.0. This variable cannot be modified after the tenant is created. In either compatibility mode, you can use the superset of features in MySQL 5.7 and 8.0 that do not have compatibility conflicts.
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='%';