mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Bug#32178 server crash when select from i_s and concurrent partition management
The crash happens because we change share->partition_info where 'share' is global struct (it affects other threads which use the same 'share'). It causes discrepancy between 'share' and handler data. The fix: Move share->partition_info update into WFRM_INSTALL_SHADOW part which is protected by OPEN_lock.
This commit is contained in:
@ -3984,6 +3984,7 @@ static int fast_end_partition(THD *thd, ulonglong copied,
|
||||
DBUG_RETURN(FALSE);
|
||||
}
|
||||
table->file->print_error(error, MYF(0));
|
||||
close_thread_tables(thd);
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
|
||||
@ -6106,7 +6107,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
|
||||
(error= table->file->repair_partitions(thd))))
|
||||
{
|
||||
table->file->print_error(error, MYF(0));
|
||||
DBUG_RETURN(TRUE);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
else if (fast_alter_partition & HA_PARTITION_ONE_PHASE)
|
||||
@ -6153,7 +6154,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
|
||||
if (mysql_write_frm(lpt, WFRM_WRITE_SHADOW | WFRM_PACK_FRM) ||
|
||||
mysql_change_partitions(lpt))
|
||||
{
|
||||
DBUG_RETURN(TRUE);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
else if (alter_info->flags == ALTER_DROP_PARTITION)
|
||||
@ -6246,7 +6247,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
|
||||
(release_name_lock(lpt), FALSE))
|
||||
{
|
||||
handle_alter_part_error(lpt, not_completed, TRUE, frm_install);
|
||||
DBUG_RETURN(TRUE);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
else if ((alter_info->flags & ALTER_ADD_PARTITION) &&
|
||||
@ -6315,7 +6316,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
|
||||
(release_name_lock(lpt), FALSE))
|
||||
{
|
||||
handle_alter_part_error(lpt, not_completed, FALSE, frm_install);
|
||||
DBUG_RETURN(TRUE);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -6408,7 +6409,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
|
||||
(release_name_lock(lpt), FALSE))
|
||||
{
|
||||
handle_alter_part_error(lpt, not_completed, FALSE, frm_install);
|
||||
DBUG_RETURN(TRUE);
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
/*
|
||||
@ -6418,6 +6419,9 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
|
||||
DBUG_RETURN(fast_end_partition(thd, lpt->copied, lpt->deleted,
|
||||
table, table_list, FALSE, NULL,
|
||||
written_bin_log));
|
||||
err:
|
||||
close_thread_tables(thd);
|
||||
DBUG_RETURN(TRUE);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Reference in New Issue
Block a user