Binlog commands
The following table lists the MySQL binlog commands supported by the binlog service of OceanBase Database.
| Command | Description | Supported |
|---|---|---|
| SHOW MASTER STATUS | Queries the latest binlog file. | Supported |
| SHOW BINARY LOGS | Queries all binlog files. | Supported |
| SHOW BINLOG EVENTS | Queries all binlog events. | Supported |
| SHOW PROCESSLIST | Queries connection sessions. | Supported |
| PURGE BINARY LOGS | Purges binlog files. | You can purge binlog files only on binlog servers but not on clients. |
The binlog service supports a variety of management commands on binlog servers. For more information, see Overview.
Binlog protocols
| Protocol | Supported |
|---|---|
| COM_BINLOG_DUMP | Supported |
| COM_BINLOG_DUMP_GTID | Supported |
| COM_REGISTER_SLAVE | Supported |
System variables
| Variable | Supported |
|---|---|
| server_id | Supported |
| server_uuid | Supported |
| binlog_format | Supported |
| binlog_row_image | Supported |
| binlog_cache_size | Supported |
| binlog_checksum | Supported |
| max_binlog_cache_size | Supported |
| max_binlog_size | Supported |
| binlog_row_query_log_events | Supported |
| log_bin | Supported |
| log_bin_basename | Supported |
| log_bin_index | Supported |
| gtid_mode | Supported |
| gtid_purged | Supported |
| gtid_executed | Supported |
| GLOBAL.GTID_EXECUTED | Supported |
| GLOBAL.GTID_PURGED | Supported |
| GTID_NEXT | Supported |
Functions
| Function | Supported |
|---|---|
| GTID_SUBSET() | Supported |
| GTID_SUBTRACT() | Supported |
| WAIT_FOR_EXECUTED_GTID_SET() | Supported |
DDL
The DDL syntax in OceanBase Database in MySQL mode differs from that in MySQL Database. Specifically, OceanBase Database in MySQL mode introduces some special syntax extensions, which may not be parsed by MySQL tools.
To address this issue, OceanBase Database provides the _show_ddl_in_compat_mode system variable since V4.1.0_CE_BP2. The system variable defaults to 0, which means the output of SHOW CREATE TABLE is not fully compatible with MySQL syntax. If you set the system variable to 1, SHOW CREATE TABLE returns a fully MySQL-compatible DDL statement.
Data types
MySQL Database and OceanBase Database in MySQL mode have differences in the precision and implementation mode of data types. Therefore, OceanBase Database does not support all data types of MySQL. Unsupported data types are described as follows:
The binlog service does not support the extended semantics of the ENUM and SET data types in OceanBase Database in MySQL mode. For example, the SET data type supports more than 64 definitions and duplication, and the ENUM data type supports the insertion of undefined data such as ''.
The VARCHAR (n > 65535) data type is not supported.
The maximum length supported for the LONGBLOB and LONGTXT data types is 48 MiB.
The MEDIUMBLOB, LONGBLOB, BLOB, MEDIUMTEXT, LONGTEXT, TEXT, JSON, and geographic information system (GIS) data types are all stored as the LOB type in the underlying layer. By default, data of a size more than 4 KiB is stored in OUTROW mode, which is incompatible with MySQL.
Data stored in OUTROW mode is updated to data stored in INROW mode. The beforeimage outputs NULL values and the afterimage outputs the updated data.
After non-LOB columns are updated for a table with a LOB column that uses the OUTROW storage mode, both the beforeimage and afterimage output NULL values.
After the LOB column that uses the OUTROW storage mode is deleted, the beforeimage outputs NULL values.
Note
A LOB column whose data is sized 4 KiB or smaller is processed as a regular column. In other words, the column data is actually recorded in a column of the primary table. For a LOB column whose data is sized more than 4 KiB, the column data is actually stored in a LOB auxiliary table, and the primary table records information about this auxiliary table. The default size of a LOB column is 4 KiB.
OceanBase Database V4.x and later do not support virtual generated columns.
The CREATE TABLE AS SELECT (CTAS) statement is not supported.
OceanBase Database V4.x cannot output the accurate table name if the table is created by using the CTAS statement. For example, the
create table t2 as select * from t1statement will create a table namedt2and write data in thet1table to thet2table. At present, OceanBase Database can output only__ctas_xxxxas a temporary table name, instead of outputting the accurate table namet2.