Hi, Sachin! On Mar 12, Sachin Setiya wrote:
revision-id: 202d1b0c897 (mariadb-10.4.3-61-g202d1b0c897) parent(s): a4b8e0c30d1 author: sachin <sachin.setiya@mariadb.com> committer: sachin <sachin.setiya@mariadb.com> timestamp: 2019-03-12 19:29:58 +0530 message:
MDEV-18809 Server crash in fields_in_hash_keyinfo or Assertion... `key_info->key_part->field->flags & (1<< 30)' failed in setup_keyinfo_hash
put the subject all on one line please, even when it's (unfortunately) long
Move calling setup_keyinfo_hash until all continue is exhausted.
okay. but there's one `goto err` still in the loop. I suspect it might be a problem, try to do a test case with ALTER TABLE DROP COLUMN from a multi-column long unique constraint.
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index a9c4c71331a..58f175d7a29 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -8304,11 +8304,6 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, long_hash_key= false; if (key_info->flags & HA_INVISIBLE_KEY) continue; - if (key_info->algorithm == HA_KEY_ALG_LONG_HASH) - { - setup_keyinfo_hash(key_info); - long_hash_key= true; - } const char *key_name= key_info->name.str; Alter_drop *drop; drop_it.rewind(); @@ -8339,6 +8334,11 @@ mysql_prepare_alter_table(THD *thd, TABLE *table, continue; }
+ if (key_info->algorithm == HA_KEY_ALG_LONG_HASH) + { + setup_keyinfo_hash(key_info); + long_hash_key= true; + } const char *dropped_key_part= NULL; KEY_PART_INFO *key_part= key_info->key_part; key_parts.empty();
Regards, Sergei Chief Architect MariaDB and security@mariadb.org