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
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 during tenant creation. This variable cannot be modified after the tenant is created. In either mode, you can use the superset of MySQL 5.7/8.0 features that do not conflict with each other.
Applicability
This variable is available only in the MySQL-compatible mode of OceanBase Database.
Privilege requirements
Query variables
systenant and all user tenants can execute theSHOW VARIABLESstatement or query theinformation_schema.GLOBAL_VARIABLESview (MySQL-compatible mode) to view the values of global system variables.Modify variables
After a tenant is created, you cannot modify the value of this variable by executing an SQL statement.
Attributes
Attribute |
Description |
|---|---|
| Type | Enum |
| Default value | MYSQL5.7 |
| Value range | ["MYSQL5.7", "MYSQL8.0"] |
| Scope | Global |
| Modifiable | No. You can specify the value of this variable when you create a tenant. After a tenant is created, you cannot modify the value of this variable 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='%';