[MDEV-30934] InnoDB: Changing a Column Data Type from VARCHAR/TEXT to a super type causes a unexpected Table Rebuild Created: 2023-03-27  Updated: 2023-11-28

Status: Open
Project: MariaDB Server
Component/s: Data types, Storage Engine - InnoDB
Affects Version/s: 10.4, 10.5, 10.6, 10.7, 10.8, 10.9, 10.10, 10.11
Fix Version/s: 10.4, 10.5, 10.6, 10.11

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Blocks
is blocked by MDEV-30969 Some ALGORITHM=INSTANT checks are mis... Open
Relates
relates to MDEV-16356 Allow ALGORITHM=NOCOPY for ADD CONSTR... Open
relates to MDEV-30669 Changing the Data Type of a Column fr... Open

 Description   

CREATE OR REPLACE TABLE t1(a INT PRIMARY KEY, data TEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin) ENGINE=InnoDB;
--error ER_ALTER_OPERATION_NOT_SUPPORTED_REASON
ALTER TABLE t1 MODIFY data LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin, ALGORITHM=INSTANT;

InnoDB does not distinguish between VARCHAR, TINYTEXT, TEXT, MEDIUMTEXT, LONGTEXT internally.
As long as the maximum length does not become smaller, the conversion can be done on the metadata level, without table rebuild (and without even validating the contents of the table).


Generated at Thu Feb 08 10:20:00 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.