mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
BUG#19122: MySQL Server crashes when ALTER TABLE t1 REBUILD PARTITION on InnoDB table
mysql-test/r/partition.result: New test case sql/lock.cc: Added new flag to lock_table_name to ensure we get proper name lock even when we already have lock on table. sql/mysql_priv.h: Added new flag to lock_table_name to ensure we get proper name lock even when we already have lock on table. Added table_list to ALTER_PARTITION_PARAM_TYPE and changed some const char * to char* sql/sql_base.cc: Added new flag to lock_table_name to ensure we get proper name lock even when we already have lock on table. Added table_list to ALTER_PARTITION_PARAM_TYPE and changed some const char * to char* sql/sql_partition.cc: New methods to 1) Get a name lock even when we already have one 2) New method that unlocks table and closes the handlers. 3) Release name lock Integrated those new methods to ensure that handlers are unlocked and closed when drop or rename is called on them. There is still some work to update the comments to reflect the last changes.
This commit is contained in:
@ -1169,7 +1169,7 @@ uint fast_alter_partition_table(THD *thd, TABLE *table,
|
||||
HA_CREATE_INFO *create_info,
|
||||
TABLE_LIST *table_list,
|
||||
List<create_field> *create_list,
|
||||
List<Key> *key_list, const char *db,
|
||||
List<Key> *key_list, char *db,
|
||||
const char *table_name,
|
||||
uint fast_alter_partition);
|
||||
uint prep_alter_part_table(THD *thd, TABLE *table, ALTER_INFO *alter_info,
|
||||
@ -1199,6 +1199,7 @@ void create_subpartition_name(char *out, const char *in1,
|
||||
|
||||
typedef struct st_lock_param_type
|
||||
{
|
||||
TABLE_LIST table_list;
|
||||
ulonglong copied;
|
||||
ulonglong deleted;
|
||||
THD *thd;
|
||||
@ -1209,7 +1210,7 @@ typedef struct st_lock_param_type
|
||||
List<Key> new_key_list;
|
||||
TABLE *table;
|
||||
KEY *key_info_buffer;
|
||||
const char *db;
|
||||
char *db;
|
||||
const char *table_name;
|
||||
const void *pack_frm_data;
|
||||
enum thr_lock_type old_lock_type;
|
||||
@ -1676,7 +1677,7 @@ void unset_protect_against_global_read_lock(void);
|
||||
|
||||
/* Lock based on name */
|
||||
int lock_and_wait_for_table_name(THD *thd, TABLE_LIST *table_list);
|
||||
int lock_table_name(THD *thd, TABLE_LIST *table_list);
|
||||
int lock_table_name(THD *thd, TABLE_LIST *table_list, bool check_in_use);
|
||||
void unlock_table_name(THD *thd, TABLE_LIST *table_list);
|
||||
bool wait_for_locked_table_names(THD *thd, TABLE_LIST *table_list);
|
||||
bool lock_table_names(THD *thd, TABLE_LIST *table_list);
|
||||
|
Reference in New Issue
Block a user