This topic describes incompatibilities between MySQL databases and the MySQL compatible mode of OceanBase Database when you change the type of an unconstrained column.
The following table describes the types to which you can change a column by executing the ALTER TABLE table_name MODIFY/CHANGE COLUMN DDL statement in a MySQL database and the MySQL compatible mode of OceanBase Database.
Note
The test results are based on OceanBase Database V3.x. For more information about the rules for changing column types in the MySQL compatible mode of OceanBase Database, see Rules for changing column types.
In the table, a hyphen (-) indicates none and 'All' indicates all types.
| Column type in MySQL database | Supported target type other than the original type | Column type in the MySQL compatible mode of OceanBase Database | Supported target type other than the original type |
|---|---|---|---|
| INT | All | INTEGER | BIGINT |
| TINYINT | All | TINYINT | INTEGER SMALLINT MEDIUMINT BIGINT BOOLEAN |
| SMALLINT | All | SMALLINT | INTEGER BIGINT MEDIUMINT |
| MEDIUMINT | All | MEDIUMINT | INTEGERBIGINT |
| BIGINT | All | BIGINT | - |
| BOOL | All | BOOLEAN | INTEGER TINYINT SMALLINT MEDIUMINT BIGINT |
| DECIMAL | All | DECIMAL | NUMERIC |
| NUMERIC | All | NUMERIC | DECIMAL |
| REAL | All | FLOAT | - |
| DOUBLE | All | DOUBLE | - |
| FLOAT | All | FLOAT | - |
| BIT | All | BIT | - |
| CHAR | All | CHAR | - |
| NCHAR | All | CHAR | - |
| VARCHAR | All | VARCHAR | TINYTEXT TEXT LONGTEXT MEDIUMTEXT |
| BINARY | All | BINARY | - |
| VARBINARY | All | VARBINARY | BLOB TINYBLOB MEDIUMBLOB LONGBLOB |
| LONG_VARBINARY | All | BLOB | - |
| YEAR | All | YEAR | - |
| DATE | All | DATE | - |
| TIME | All | TIME | - |
| TIMESTAMP | All | TIMESTAMP | - |
| DATETIME | All | DATETIME | - |
| TINYBLOB | All | TINYBLOB | BLOB LONGBLOB MEDIUMBLOB |
| MEDIUMBLOB | All | MEDIUMBLOB | - |
| BLOB | All | BLOB | - |
| LONGBLOB | All | LONGBLOB | - |
| TINYTEXT | All | TINYTEXT | TEXT LONGTEXT MEDIUMTEXT |
| MEDIUMTEXT | All | MEDIUMTEXT | - |
| TEXT | All | TEXT | - |
| LONGTEXT | All | LONGTEXT | - |
| ENUM | All | ENUM | - |
| SET | All | SET | - |
| JSON | All | JSON | - |