Details
-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Major
-
Resolution: Duplicate
-
Affects Version/s: 10.4.3
-
Fix Version/s: N/A
-
Component/s: Data Definition - Alter Table, Storage Engine - InnoDB
Description
It was the intention of MDEV-15564 to allow ALGORITHM=NOCOPY for changing the character set or collation of an indexed column. Currently, such operations will degrade to ALGORITHM=COPY:
Please see the test innodb.instant_alter_charset. We would expect results like
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: ADD INDEX. Try ALGORITHM=NOCOPY
but instead, we currently get the following:
ERROR 0A000: ALGORITHM=INSTANT is not supported. Reason: Cannot change column type INPLACE. Try ALGORITHM=COPY
I believe that this is due to the following in Field_str::is_equal() and Field_varstring::is_equal():
if (!Type_handler::Charsets_are_compatible(field_charset, new_field->charset, |
part_of_a_key))
|
return IS_EQUAL_NO; |
Maybe we need variants of IS_EQUAL_PACK_LENGTH and IS_EQUAL_PACK_LENGTH_EXT that indicate that the column is indexed, and therefore the SQL layer must request the indexes to be dropped and added.
Attachments
Issue Links
- duplicates
-
MDEV-17301 Change of COLLATE unnecessarily requires ALGORITHM=COPY
-
- Closed
-