Change the type of an unconstrained column

2023-06-29 11:11:39  Updated

This topic describes incompatibilities between MySQL databases and MySQL tenants 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 a MySQL tenant of OceanBase Database.

Note

In the following table, a hyphen (-) means N/A. 'All' means all types.

Column type in a MySQL database Supported target type other than the original type Column type in a MySQL tenant 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 -

Contact Us