Change the length of an unconstrained column

2025-05-12 01:55:52  Updated

This topic describes incompatibilities between MySQL databases and MySQL-compatible tenants of OceanBase Database when you change the length of an unconstrained column.

The following table describes the operations that you can perform to change the length of a column by executing the ALTER TABLE table_name MODIFY/CHANGE COLUMN DDL statement in a MySQL database and a MySQL-compatible tenant of OceanBase Database.

Note

In the table, a hyphen (-) indicates none.

Column type in a MySQL database Allowed operation Column type in a MySQL-compatible tenant of OceanBase Database Allowed operation
INT Increase and decrease the length INTEGER Increase and decrease the length
TINYINT Increase and decrease the length TINYINT Increase and decrease the length
SMALLINT Increase and decrease the length SMALLINT Increase and decrease the length
MEDIUMINT Increase and decrease the length MEDIUMINT Increase and decrease the length
BIGINT Increase and decrease the length BIGINT Increase and decrease the length
BOOL - BOOLEAN -
DECIMAL Increase and decrease the length DECIMAL Increase the length
NUMERIC Increase and decrease the length NUMERIC Increase the length
REAL Increase and decrease the length FLOAT Increase and decrease the length
DOUBLE Increase and decrease the length DOUBLE Increase and decrease the length
FLOAT Increase and decrease the length FLOAT Increase and decrease the length
BIT Increase and decrease the length BIT Increase and decrease the length
CHAR Increase and decrease the length CHAR Increase the length
NCHAR Increase and decrease the length CHAR Increase the length
VARCHAR Increase and decrease the length VARCHAR Increase the length
BINARY Increase and decrease the length BINARY -
VARBINARY Increase and decrease the length VARBINARY Increase the length
LONG_VARBINARY - BLOB -
YEAR Increase and decrease the length YEAR Increase the length (the length is fixed to be 4 bytes)
DATE - DATE -
TIME Increase and decrease the length TIME Increase the length
TIMESTAMP Increase and decrease the length TIMESTAMP Increase the length
DATETIME Increase and decrease the length DATETIME Increase the length
TINYBLOB - TINYBLOB -
MEDIUMBLOB - MEDIUMBLOB -
BLOB - BLOB -
LONGBLOB - LONGBLOB -
TINYTEXT - TINYTEXT -
MEDIUMTEXT - MEDIUMTEXT -
TEXT - TEXT -
LONGTEXT - LONGTEXT -
ENUM Increase and decrease the length ENUM Increase the length
SET Increase and decrease the length SET Increase the length
JSON - JSON -

Contact Us