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 have conflicting behaviors in some scenarios. For example, REPLACE('abd','',null) returns different results in MySQL 5.7 and 8.0. ob_compatibility_control specifies whether to follow MySQL 5.7 or MySQL 8.0 behavior when you create a tenant and a compatibility conflict arises. This variable cannot be modified after the tenant is created. In either compatibility mode, you can use the superset of MySQL 5.7 and 8.0 features that are free of compatibility conflicts.
Applicability
This variable applies only to the MySQL-compatible 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-compatible 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 were already implemented following MySQL 8.0 behavior in earlier versions, if
ob_compatibility_version < 4.2.3, these features remain 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='%';
