diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc
|
index 3ac4f4fe4c1..1b4b48e90f7 100644
|
--- a/storage/innobase/handler/handler0alter.cc
|
+++ b/storage/innobase/handler/handler0alter.cc
|
@@ -5601,7 +5601,14 @@ ha_innobase::prepare_inplace_alter_table(
|
& 1U << DICT_TF_POS_DATA_DIR);
|
}
|
|
- max_col_len = DICT_MAX_FIELD_LEN_BY_FORMAT_FLAG(info.flags());
|
+
|
+ /* ALGORITHM=COPY uses the default row format while
|
+ ALGORITHM=INPLACE uses the current format. Find the limit for
|
+ the resulting format.*/
|
+ max_col_len = DICT_MAX_FIELD_LEN_BY_FORMAT_FLAG(
|
+ innobase_need_rebuild(ha_alter_info, this->table)
|
+ ? info.flags()
|
+ : m_prebuilt->table->flags);
|
|
/* Check each index's column length to make sure they do not
|
exceed limit */
|