From 2a57396e59e42cbfac51bed5231c2bdb2d7fe39a Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Fri, 21 Oct 2022 12:33:22 +0400 Subject: MDEV-29481 mariadb-upgrade prints confusing statement This is a new version of the patch instead of the reverted: MDEV-28727 ALTER TABLE ALGORITHM=NOCOPY does not work after upgrade Ignore the difference in key packing flags HA_BINARY_PACK_KEY and HA_PACK_KEY during ALTER to allow ALGORITHM=INSTANT and ALGORITHM=NOCOPY in more cases. If for some reasons (e.g. due to a bug fix such as MDEV-20704) these cumulative (over all segments) flags in KEY::flags are different for the old and new table inside compare_keys_but_name(), the difference in HA_BINARY_PACK_KEY and HA_PACK_KEY in KEY::flags is not really important: MyISAM and Aria can handle such cases well: per-segment flags are stored in MYI and MAI files anyway and they are read during ha_myisam::open() ha_maria::open() time. So indexes get opened with correct per-segment flags that were calculated during the table CREATE time, no matter what the old (CREATE time) and new (ALTER TIME) per-index compression flags are, and no matter if they are equal or not. All other engine ignore key compression flags, so this change is safe for other engines as well. --- include/my_base.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/my_base.h b/include/my_base.h index 7016766ce58..d045251778f 100644 --- a/include/my_base.h +++ b/include/my_base.h @@ -272,8 +272,8 @@ enum ha_base_keytype { #define HA_GENERATED_KEY 8192U /* Automatically generated key */ /* The combination of the above can be used for key type comparison. */ -#define HA_KEYFLAG_MASK (HA_NOSAME | HA_PACK_KEY | HA_AUTO_KEY | \ - HA_BINARY_PACK_KEY | HA_FULLTEXT | HA_UNIQUE_CHECK | \ +#define HA_KEYFLAG_MASK (HA_NOSAME | HA_AUTO_KEY | \ + HA_FULLTEXT | HA_UNIQUE_CHECK | \ HA_SPATIAL | HA_NULL_ARE_EQUAL | HA_GENERATED_KEY) /* -- cgit v1.2.1