summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2022-02-17 11:58:25 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2022-02-17 11:58:25 +0200
commitcac995ec6f7d23c5b725e6ee19fc4f6ed38561f1 (patch)
treeec7be6811f5cf5f08676d0f2b5bc6671689a0347 /storage
parent5948d7602ec7f61937c368dcb134e6ec226a2990 (diff)
parent6f4740fde709b94681bab6d66317ddabeac2c252 (diff)
downloadmariadb-git-cac995ec6f7d23c5b725e6ee19fc4f6ed38561f1.tar.gz
Merge 10.4 into 10.5
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/handler/ha_innodb.cc3
-rw-r--r--storage/maria/ha_maria.cc12
2 files changed, 10 insertions, 5 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index b9f2ea67632..487a5e8526d 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -1641,7 +1641,7 @@ convert_error_code_to_mysql(
"constraints that exceed max "
"depth of %d. Please "
"drop extra constraints and try "
- "again", DICT_FK_MAX_RECURSIVE_LOAD);
+ "again", FK_MAX_CASCADE_DEL);
return(HA_ERR_FK_DEPTH_EXCEEDED);
case DB_CANT_CREATE_GEOMETRY_OBJECT:
@@ -12902,7 +12902,6 @@ bool create_table_info_t::row_size_is_acceptable(
if (info.row_is_too_big())
{
ut_ad(info.get_overrun_size() != 0);
- ut_ad(info.max_leaf_size != 0);
const size_t idx= info.get_first_overrun_field_index();
const dict_field_t *field= dict_index_get_nth_field(&index, idx);
diff --git a/storage/maria/ha_maria.cc b/storage/maria/ha_maria.cc
index ce23e670c17..cc18163194d 100644
--- a/storage/maria/ha_maria.cc
+++ b/storage/maria/ha_maria.cc
@@ -2064,13 +2064,19 @@ int ha_maria::enable_indexes(uint mode)
param->orig_sort_buffer_length= THDVAR(thd,sort_buffer_size);
param->stats_method= (enum_handler_stats_method)THDVAR(thd,stats_method);
param->tmpdir= &mysql_tmpdir_list;
- if ((error= (repair(thd, param, 0) != HA_ADMIN_OK)) && param->retry_repair)
+
+ /*
+ Don't retry repair if we get duplicate key error if
+ create_unique_index_by_sort is enabled
+ This can be set when doing an ALTER TABLE and enabling unique keys
+ */
+ if ((error= (repair(thd, param, 0) != HA_ADMIN_OK)) && param->retry_repair &&
+ (my_errno != HA_ERR_FOUND_DUPP_KEY ||
+ !file->create_unique_index_by_sort))
{
sql_print_warning("Warning: Enabling keys got errno %d on %s.%s, "
"retrying",
my_errno, param->db_name, param->table_name);
- /* This should never fail normally */
- DBUG_ASSERT(thd->killed != 0);
/* Repairing by sort failed. Now try standard repair method. */
param->testflag &= ~T_REP_BY_SORT;
file->state->records= start_rows;