diff options
author | Monty <monty@mariadb.org> | 2020-10-12 11:21:05 +0300 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2021-05-19 22:54:11 +0200 |
commit | 188b0b99cf3d96ccf443eae57758d504509d5a9f (patch) | |
tree | a5c6bc343593e1f929dc78076e87f31967cb1e85 | |
parent | 02b6cef45e8a4558dc7cc61630d5277848b08b43 (diff) | |
download | mariadb-git-188b0b99cf3d96ccf443eae57758d504509d5a9f.tar.gz |
Rename all external ddl_log function to start with ddl_log_ prefix
Rename deactivate_ddl_log_entry to ddl_log_increment_phase
-rw-r--r-- | libmysqld/lib_sql.cc | 2 | ||||
-rw-r--r-- | sql/ddl_log.cc | 88 | ||||
-rw-r--r-- | sql/ddl_log.h | 16 | ||||
-rw-r--r-- | sql/ha_partition.cc | 26 | ||||
-rw-r--r-- | sql/mysqld.cc | 6 | ||||
-rw-r--r-- | sql/sql_partition.cc | 26 | ||||
-rw-r--r-- | sql/sql_partition_admin.cc | 18 | ||||
-rw-r--r-- | sql/sql_table.cc | 8 |
8 files changed, 95 insertions, 95 deletions
diff --git a/libmysqld/lib_sql.cc b/libmysqld/lib_sql.cc index dfff28e8903..b238504acc2 100644 --- a/libmysqld/lib_sql.cc +++ b/libmysqld/lib_sql.cc @@ -641,7 +641,7 @@ int init_embedded_server(int argc, char **argv, char **groups) } } - execute_ddl_log_recovery(); + ddl_log_execute_recovery(); mysql_embedded_init= 1; return 0; } diff --git a/sql/ddl_log.cc b/sql/ddl_log.cc index d927cc879e0..43e065e44ab 100644 --- a/sql/ddl_log.cc +++ b/sql/ddl_log.cc @@ -146,9 +146,9 @@ static bool write_ddl_log_file_entry(uint entry_no) */ -static bool sync_ddl_log_file() +static bool ddl_log_sync_file() { - DBUG_ENTER("sync_ddl_log_file"); + DBUG_ENTER("ddl_log_sync_file"); DBUG_RETURN(mysql_file_sync(global_ddl_log.file_id, MYF(MY_WME))); } @@ -179,7 +179,7 @@ static bool write_ddl_log_header() sql_print_error("Error writing ddl log header"); DBUG_RETURN(TRUE); } - DBUG_RETURN(sync_ddl_log_file()); + DBUG_RETURN(ddl_log_sync_file()); } @@ -408,9 +408,9 @@ end: @retval FALSE Success */ -static bool sync_ddl_log_no_lock() +static bool ddl_log_sync_no_lock() { - DBUG_ENTER("sync_ddl_log_no_lock"); + DBUG_ENTER("ddl_log_sync_no_lock"); mysql_mutex_assert_owner(&LOCK_gdl); if ((!global_ddl_log.recovery_phase) && @@ -418,7 +418,7 @@ static bool sync_ddl_log_no_lock() { DBUG_RETURN(TRUE); } - DBUG_RETURN(sync_ddl_log_file()); + DBUG_RETURN(ddl_log_sync_file()); } @@ -449,10 +449,10 @@ static bool sync_ddl_log_no_lock() @retval FALSE Success */ -static bool deactivate_ddl_log_entry_no_lock(uint entry_no) +static bool ddl_log_increment_phase_no_lock(uint entry_no) { uchar *file_entry_buf= (uchar*)global_ddl_log.file_entry_buf; - DBUG_ENTER("deactivate_ddl_log_entry_no_lock"); + DBUG_ENTER("ddl_log_increment_phase_no_lock"); mysql_mutex_assert_owner(&LOCK_gdl); if (!read_ddl_log_file_entry(entry_no)) @@ -585,9 +585,9 @@ static int execute_ddl_log_action(THD *thd, DDL_LOG_ENTRY *ddl_log_entry) break; } } - if ((deactivate_ddl_log_entry_no_lock(ddl_log_entry->entry_pos))) + if ((ddl_log_increment_phase_no_lock(ddl_log_entry->entry_pos))) break; - (void) sync_ddl_log_no_lock(); + (void) ddl_log_sync_no_lock(); error= 0; if (ddl_log_entry->action_type == DDL_LOG_DELETE_ACTION) break; @@ -621,9 +621,9 @@ static int execute_ddl_log_action(THD *thd, DDL_LOG_ENTRY *ddl_log_entry) ddl_log_entry->name)) break; } - if ((deactivate_ddl_log_entry_no_lock(ddl_log_entry->entry_pos))) + if ((ddl_log_increment_phase_no_lock(ddl_log_entry->entry_pos))) break; - (void) sync_ddl_log_no_lock(); + (void) ddl_log_sync_no_lock(); error= FALSE; break; } @@ -646,7 +646,7 @@ static int execute_ddl_log_action(THD *thd, DDL_LOG_ENTRY *ddl_log_entry) file_entry_buf[DDL_LOG_PHASE_POS]--; if (write_ddl_log_file_entry(ddl_log_entry->entry_pos)) break; - if (sync_ddl_log_no_lock()) + if (ddl_log_sync_no_lock()) break; /* fall through */ case EXCH_PHASE_FROM_TO_NAME: @@ -657,7 +657,7 @@ static int execute_ddl_log_action(THD *thd, DDL_LOG_ENTRY *ddl_log_entry) file_entry_buf[DDL_LOG_PHASE_POS]--; if (write_ddl_log_file_entry(ddl_log_entry->entry_pos)) break; - if (sync_ddl_log_no_lock()) + if (ddl_log_sync_no_lock()) break; /* fall through */ case EXCH_PHASE_NAME_TO_TEMP: @@ -668,7 +668,7 @@ static int execute_ddl_log_action(THD *thd, DDL_LOG_ENTRY *ddl_log_entry) file_entry_buf[DDL_LOG_ENTRY_TYPE_POS]= DDL_IGNORE_LOG_ENTRY_CODE; if (write_ddl_log_file_entry(ddl_log_entry->entry_pos)) break; - if (sync_ddl_log_no_lock()) + if (ddl_log_sync_no_lock()) break; error= FALSE; break; @@ -752,11 +752,11 @@ static bool get_free_ddl_log_entry(DDL_LOG_MEMORY_ENTRY **active_entry, @retval FALSE Success */ -static bool execute_ddl_log_entry_no_lock(THD *thd, uint first_entry) +static bool ddl_log_execute_entry_no_lock(THD *thd, uint first_entry) { DDL_LOG_ENTRY ddl_log_entry; uint read_entry= first_entry; - DBUG_ENTER("execute_ddl_log_entry_no_lock"); + DBUG_ENTER("ddl_log_execute_entry_no_lock"); mysql_mutex_assert_owner(&LOCK_gdl); do @@ -803,11 +803,11 @@ static bool execute_ddl_log_entry_no_lock(THD *thd, uint first_entry) @retval FALSE Success */ -bool write_ddl_log_entry(DDL_LOG_ENTRY *ddl_log_entry, +bool ddl_log_write_entry(DDL_LOG_ENTRY *ddl_log_entry, DDL_LOG_MEMORY_ENTRY **active_entry) { bool error, write_header; - DBUG_ENTER("write_ddl_log_entry"); + DBUG_ENTER("ddl_log_write_entry"); mysql_mutex_assert_owner(&LOCK_gdl); if (init_ddl_log()) @@ -840,12 +840,12 @@ bool write_ddl_log_entry(DDL_LOG_ENTRY *ddl_log_entry, } if (write_header && likely(!error)) { - (void) sync_ddl_log_no_lock(); + (void) ddl_log_sync_no_lock(); if (write_ddl_log_header()) error= TRUE; } if (unlikely(error)) - release_ddl_log_memory_entry(*active_entry); + ddl_log_release_memory_entry(*active_entry); DBUG_RETURN(error); } @@ -876,13 +876,13 @@ bool write_ddl_log_entry(DDL_LOG_ENTRY *ddl_log_entry, @retval FALSE Success */ -bool write_execute_ddl_log_entry(uint first_entry, +bool ddl_log_write_execute_entry(uint first_entry, bool complete, DDL_LOG_MEMORY_ENTRY **active_entry) { bool write_header= FALSE; char *file_entry_buf= (char*)global_ddl_log.file_entry_buf; - DBUG_ENTER("write_execute_ddl_log_entry"); + DBUG_ENTER("ddl_log_write_execute_entry"); mysql_mutex_assert_owner(&LOCK_gdl); if (init_ddl_log()) @@ -897,7 +897,7 @@ bool write_execute_ddl_log_entry(uint first_entry, any log entries before, we are only here to write the execute entry to indicate it is done. */ - (void) sync_ddl_log_no_lock(); + (void) ddl_log_sync_no_lock(); file_entry_buf[DDL_LOG_ENTRY_TYPE_POS]= (char)DDL_LOG_EXECUTE_CODE; } else @@ -919,15 +919,15 @@ bool write_execute_ddl_log_entry(uint first_entry, if (write_ddl_log_file_entry((*active_entry)->entry_pos)) { sql_print_error("Error writing execute entry in ddl log"); - release_ddl_log_memory_entry(*active_entry); + ddl_log_release_memory_entry(*active_entry); DBUG_RETURN(TRUE); } - (void) sync_ddl_log_no_lock(); + (void) ddl_log_sync_no_lock(); if (write_header) { if (write_ddl_log_header()) { - release_ddl_log_memory_entry(*active_entry); + ddl_log_release_memory_entry(*active_entry); DBUG_RETURN(TRUE); } } @@ -938,7 +938,7 @@ bool write_execute_ddl_log_entry(uint first_entry, /** Deactivate an individual entry. - @details see deactivate_ddl_log_entry_no_lock. + @details see ddl_log_increment_phase_no_lock. @param entry_no Entry position of record to change @@ -947,13 +947,13 @@ bool write_execute_ddl_log_entry(uint first_entry, @retval FALSE Success */ -bool deactivate_ddl_log_entry(uint entry_no) +bool ddl_log_increment_phase(uint entry_no) { bool error; - DBUG_ENTER("deactivate_ddl_log_entry"); + DBUG_ENTER("ddl_log_increment_phase"); mysql_mutex_lock(&LOCK_gdl); - error= deactivate_ddl_log_entry_no_lock(entry_no); + error= ddl_log_increment_phase_no_lock(entry_no); mysql_mutex_unlock(&LOCK_gdl); DBUG_RETURN(error); } @@ -967,13 +967,13 @@ bool deactivate_ddl_log_entry(uint entry_no) @retval FALSE Success */ -bool sync_ddl_log() +bool ddl_log_sync() { bool error; - DBUG_ENTER("sync_ddl_log"); + DBUG_ENTER("ddl_log_sync"); mysql_mutex_lock(&LOCK_gdl); - error= sync_ddl_log_no_lock(); + error= ddl_log_sync_no_lock(); mysql_mutex_unlock(&LOCK_gdl); DBUG_RETURN(error); @@ -985,12 +985,12 @@ bool sync_ddl_log() @param log_memory_entry Log memory entry to release */ -void release_ddl_log_memory_entry(DDL_LOG_MEMORY_ENTRY *log_entry) +void ddl_log_release_memory_entry(DDL_LOG_MEMORY_ENTRY *log_entry) { DDL_LOG_MEMORY_ENTRY *first_free= global_ddl_log.first_free; DDL_LOG_MEMORY_ENTRY *next_log_entry= log_entry->next_log_entry; DDL_LOG_MEMORY_ENTRY *prev_log_entry= log_entry->prev_log_entry; - DBUG_ENTER("release_ddl_log_memory_entry"); + DBUG_ENTER("ddl_log_release_memory_entry"); mysql_mutex_assert_owner(&LOCK_gdl); global_ddl_log.first_free= log_entry; @@ -1018,13 +1018,13 @@ void release_ddl_log_memory_entry(DDL_LOG_MEMORY_ENTRY *log_entry) @retval FALSE Success */ -bool execute_ddl_log_entry(THD *thd, uint first_entry) +bool ddl_log_execute_entry(THD *thd, uint first_entry) { bool error; - DBUG_ENTER("execute_ddl_log_entry"); + DBUG_ENTER("ddl_log_execute_entry"); mysql_mutex_lock(&LOCK_gdl); - error= execute_ddl_log_entry_no_lock(thd, first_entry); + error= ddl_log_execute_entry_no_lock(thd, first_entry); mysql_mutex_unlock(&LOCK_gdl); DBUG_RETURN(error); } @@ -1050,14 +1050,14 @@ static void close_ddl_log() Execute the ddl log at recovery of MySQL Server. */ -void execute_ddl_log_recovery() +void ddl_log_execute_recovery() { uint num_entries, i; THD *thd, *original_thd; DDL_LOG_ENTRY ddl_log_entry; char file_name[FN_REFLEN]; static char recover_query_string[]= "INTERNAL DDL LOG RECOVER IN PROGRESS"; - DBUG_ENTER("execute_ddl_log_recovery"); + DBUG_ENTER("ddl_log_execute_recovery"); /* Initialise global_ddl_log struct @@ -1092,7 +1092,7 @@ void execute_ddl_log_recovery() } if (ddl_log_entry.entry_type == DDL_LOG_EXECUTE_CODE) { - if (execute_ddl_log_entry_no_lock(thd, ddl_log_entry.next_entry)) + if (ddl_log_execute_entry_no_lock(thd, ddl_log_entry.next_entry)) { /* Real unpleasant scenario but we continue anyways. */ continue; @@ -1115,11 +1115,11 @@ void execute_ddl_log_recovery() Release all memory allocated to the ddl log. */ -void release_ddl_log() +void ddl_log_release() { DDL_LOG_MEMORY_ENTRY *free_list; DDL_LOG_MEMORY_ENTRY *used_list; - DBUG_ENTER("release_ddl_log"); + DBUG_ENTER("ddl_log_release"); if (!global_ddl_log.do_release) DBUG_VOID_RETURN; diff --git a/sql/ddl_log.h b/sql/ddl_log.h index e2ed648b86c..0747699cd85 100644 --- a/sql/ddl_log.h +++ b/sql/ddl_log.h @@ -95,17 +95,17 @@ typedef struct st_ddl_log_memory_entry } DDL_LOG_MEMORY_ENTRY; -bool write_ddl_log_entry(DDL_LOG_ENTRY *ddl_log_entry, +bool ddl_log_write_entry(DDL_LOG_ENTRY *ddl_log_entry, DDL_LOG_MEMORY_ENTRY **active_entry); -bool write_execute_ddl_log_entry(uint first_entry, +bool ddl_log_write_execute_entry(uint first_entry, bool complete, DDL_LOG_MEMORY_ENTRY **active_entry); -bool deactivate_ddl_log_entry(uint entry_no); -void release_ddl_log_memory_entry(DDL_LOG_MEMORY_ENTRY *log_entry); -bool sync_ddl_log(); -void release_ddl_log(); -void execute_ddl_log_recovery(); -bool execute_ddl_log_entry(THD *thd, uint first_entry); +bool ddl_log_increment_phase(uint entry_no); +void ddl_log_release_memory_entry(DDL_LOG_MEMORY_ENTRY *log_entry); +bool ddl_log_sync(); +void ddl_log_release(); +void ddl_log_execute_recovery(); +bool ddl_log_execute_entry(THD *thd, uint first_entry); extern mysql_mutex_t LOCK_gdl; #endif /* DDL_LOG_INCLUDED */ diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 08fae652b5e..4148053a5ac 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -914,7 +914,7 @@ int ha_partition::drop_partitions(const char *path) DBUG_PRINT("info", ("Drop subpartition %s", part_name_buff)); if (unlikely((ret_error= file->delete_table(part_name_buff)))) error= ret_error; - if (unlikely(deactivate_ddl_log_entry(sub_elem->log_entry-> + if (unlikely(ddl_log_increment_phase(sub_elem->log_entry-> entry_pos))) error= 1; } while (++j < num_subparts); @@ -931,7 +931,7 @@ int ha_partition::drop_partitions(const char *path) DBUG_PRINT("info", ("Drop partition %s", part_name_buff)); if (unlikely((ret_error= file->delete_table(part_name_buff)))) error= ret_error; - if (unlikely(deactivate_ddl_log_entry(part_elem->log_entry-> + if (unlikely(ddl_log_increment_phase(part_elem->log_entry-> entry_pos))) error= 1; } @@ -942,7 +942,7 @@ int ha_partition::drop_partitions(const char *path) part_elem->part_state= PART_IS_DROPPED; } } while (++i < num_parts); - (void) sync_ddl_log(); + (void) ddl_log_sync(); DBUG_RETURN(error); } @@ -1023,7 +1023,7 @@ int ha_partition::rename_partitions(const char *path) DBUG_PRINT("info", ("Delete subpartition %s", norm_name_buff)); if (unlikely((ret_error= file->delete_table(norm_name_buff)))) error= ret_error; - else if (unlikely(deactivate_ddl_log_entry(sub_elem->log_entry-> + else if (unlikely(ddl_log_increment_phase(sub_elem->log_entry-> entry_pos))) error= 1; else @@ -1044,7 +1044,7 @@ int ha_partition::rename_partitions(const char *path) DBUG_PRINT("info", ("Delete partition %s", norm_name_buff)); if (unlikely((ret_error= file->delete_table(norm_name_buff)))) error= ret_error; - else if (unlikely(deactivate_ddl_log_entry(part_elem->log_entry-> + else if (unlikely(ddl_log_increment_phase(part_elem->log_entry-> entry_pos))) error= 1; else @@ -1052,7 +1052,7 @@ int ha_partition::rename_partitions(const char *path) } } } while (++i < temp_partitions); - (void) sync_ddl_log(); + (void) ddl_log_sync(); } i= 0; do @@ -1105,10 +1105,10 @@ int ha_partition::rename_partitions(const char *path) DBUG_PRINT("info", ("Delete subpartition %s", norm_name_buff)); if (unlikely((ret_error= file->delete_table(norm_name_buff)))) error= ret_error; - else if (unlikely(deactivate_ddl_log_entry(sub_elem->log_entry-> + else if (unlikely(ddl_log_increment_phase(sub_elem->log_entry-> entry_pos))) error= 1; - (void) sync_ddl_log(); + (void) ddl_log_sync(); } file= m_new_file[part]; if (unlikely((ret_error= @@ -1123,7 +1123,7 @@ int ha_partition::rename_partitions(const char *path) if (unlikely((ret_error= file->ha_rename_table(part_name_buff, norm_name_buff)))) error= ret_error; - else if (unlikely(deactivate_ddl_log_entry(sub_elem->log_entry-> + else if (unlikely(ddl_log_increment_phase(sub_elem->log_entry-> entry_pos))) error= 1; else @@ -1152,10 +1152,10 @@ int ha_partition::rename_partitions(const char *path) DBUG_PRINT("info", ("Delete partition %s", norm_name_buff)); if (unlikely((ret_error= file->delete_table(norm_name_buff)))) error= ret_error; - else if (unlikely(deactivate_ddl_log_entry(part_elem->log_entry-> + else if (unlikely(ddl_log_increment_phase(part_elem->log_entry-> entry_pos))) error= 1; - (void) sync_ddl_log(); + (void) ddl_log_sync(); } file= m_new_file[i]; DBUG_PRINT("info", ("Rename partition from %s to %s", @@ -1163,7 +1163,7 @@ int ha_partition::rename_partitions(const char *path) if (unlikely((ret_error= file->ha_rename_table(part_name_buff, norm_name_buff)))) error= ret_error; - else if (unlikely(deactivate_ddl_log_entry(part_elem->log_entry-> + else if (unlikely(ddl_log_increment_phase(part_elem->log_entry-> entry_pos))) error= 1; else @@ -1172,7 +1172,7 @@ int ha_partition::rename_partitions(const char *path) } } } while (++i < num_parts); - (void) sync_ddl_log(); + (void) ddl_log_sync(); DBUG_RETURN(error); } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 57cc83eaf43..f8b5889488e 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -30,7 +30,7 @@ #include "parse_file.h" // File_parser_dummy_hook #include "sql_db.h" // my_dboptions_cache_free // my_dboptions_cache_init -#include "sql_table.h" // release_ddl_log, execute_ddl_log_recovery +#include "sql_table.h" // ddl_log_release, ddl_log_execute_recovery #include "sql_connect.h" // free_max_user_conn, init_max_user_conn, // handle_one_connection #include "thread_cache.h" @@ -1890,7 +1890,7 @@ static void clean_up(bool print_message) my_bitmap_free(&slave_error_mask); #endif stop_handle_manager(); - release_ddl_log(); + ddl_log_release(); logger.cleanup_base(); @@ -5680,7 +5680,7 @@ int mysqld_main(int argc, char **argv) initialize_information_schema_acl(); - execute_ddl_log_recovery(); + ddl_log_execute_recovery(); /* Change EVENTS_ORIGINAL to EVENTS_OFF (the default value) as there is no diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index d5a989de6ff..9afdd6f9dc0 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -6168,7 +6168,7 @@ static void release_part_info_log_entries(DDL_LOG_MEMORY_ENTRY *log_entry) while (log_entry) { - release_ddl_log_memory_entry(log_entry); + ddl_log_release_memory_entry(log_entry); log_entry= log_entry->next_active_log_entry; } DBUG_VOID_RETURN; @@ -6212,7 +6212,7 @@ static bool write_log_replace_delete_frm(ALTER_PARTITION_PARAM_TYPE *lpt, ddl_log_entry.name= to_path; if (replace_flag) ddl_log_entry.from_name= from_path; - if (write_ddl_log_entry(&ddl_log_entry, &log_entry)) + if (ddl_log_write_entry(&ddl_log_entry, &log_entry)) { DBUG_RETURN(TRUE); } @@ -6289,7 +6289,7 @@ static bool write_log_changed_partitions(ALTER_PARTITION_PARAM_TYPE *lpt, ddl_log_entry.action_type= DDL_LOG_REPLACE_ACTION; else ddl_log_entry.action_type= DDL_LOG_RENAME_ACTION; - if (write_ddl_log_entry(&ddl_log_entry, &log_entry)) + if (ddl_log_write_entry(&ddl_log_entry, &log_entry)) { DBUG_RETURN(TRUE); } @@ -6316,7 +6316,7 @@ static bool write_log_changed_partitions(ALTER_PARTITION_PARAM_TYPE *lpt, ddl_log_entry.action_type= DDL_LOG_REPLACE_ACTION; else ddl_log_entry.action_type= DDL_LOG_RENAME_ACTION; - if (write_ddl_log_entry(&ddl_log_entry, &log_entry)) + if (ddl_log_write_entry(&ddl_log_entry, &log_entry)) { DBUG_RETURN(TRUE); } @@ -6392,7 +6392,7 @@ static bool write_log_dropped_partitions(ALTER_PARTITION_PARAM_TYPE *lpt, sub_elem->partition_name, name_variant)) DBUG_RETURN(TRUE); ddl_log_entry.name= tmp_path; - if (write_ddl_log_entry(&ddl_log_entry, &log_entry)) + if (ddl_log_write_entry(&ddl_log_entry, &log_entry)) { DBUG_RETURN(TRUE); } @@ -6411,7 +6411,7 @@ static bool write_log_dropped_partitions(ALTER_PARTITION_PARAM_TYPE *lpt, TRUE)) DBUG_RETURN(TRUE); ddl_log_entry.name= tmp_path; - if (write_ddl_log_entry(&ddl_log_entry, &log_entry)) + if (ddl_log_write_entry(&ddl_log_entry, &log_entry)) { DBUG_RETURN(TRUE); } @@ -6473,7 +6473,7 @@ static bool write_log_drop_shadow_frm(ALTER_PARTITION_PARAM_TYPE *lpt) (const char*)shadow_path, FALSE)) goto error; log_entry= part_info->first_log_entry; - if (write_execute_ddl_log_entry(log_entry->entry_pos, + if (ddl_log_write_execute_entry(log_entry->entry_pos, FALSE, &exec_log_entry)) goto error; mysql_mutex_unlock(&LOCK_gdl); @@ -6520,7 +6520,7 @@ static bool write_log_rename_frm(ALTER_PARTITION_PARAM_TYPE *lpt) goto error; log_entry= part_info->first_log_entry; part_info->frm_log_entry= log_entry; - if (write_execute_ddl_log_entry(log_entry->entry_pos, + if (ddl_log_write_execute_entry(log_entry->entry_pos, FALSE, &exec_log_entry)) goto error; release_part_info_log_entries(old_first_log_entry); @@ -6575,7 +6575,7 @@ static bool write_log_drop_partition(ALTER_PARTITION_PARAM_TYPE *lpt) goto error; log_entry= part_info->first_log_entry; part_info->frm_log_entry= log_entry; - if (write_execute_ddl_log_entry(log_entry->entry_pos, + if (ddl_log_write_execute_entry(log_entry->entry_pos, FALSE, &exec_log_entry)) goto error; release_part_info_log_entries(old_first_log_entry); @@ -6634,7 +6634,7 @@ static bool write_log_add_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt) goto error; log_entry= part_info->first_log_entry; - if (write_execute_ddl_log_entry(log_entry->entry_pos, + if (ddl_log_write_execute_entry(log_entry->entry_pos, FALSE, /* Reuse the old execute ddl_log_entry */ &exec_log_entry)) @@ -6704,7 +6704,7 @@ static bool write_log_final_change_partition(ALTER_PARTITION_PARAM_TYPE *lpt) log_entry= part_info->first_log_entry; part_info->frm_log_entry= log_entry; /* Overwrite the revert execute log entry with this retry execute entry */ - if (write_execute_ddl_log_entry(log_entry->entry_pos, + if (ddl_log_write_execute_entry(log_entry->entry_pos, FALSE, &exec_log_entry)) goto error; release_part_info_log_entries(old_first_log_entry); @@ -6741,7 +6741,7 @@ static void write_log_completed(ALTER_PARTITION_PARAM_TYPE *lpt, DBUG_ASSERT(log_entry); mysql_mutex_lock(&LOCK_gdl); - if (write_execute_ddl_log_entry(0UL, TRUE, &log_entry)) + if (ddl_log_write_execute_entry(0UL, TRUE, &log_entry)) { /* Failed to write, Bad... @@ -6891,7 +6891,7 @@ static void handle_alter_part_error(ALTER_PARTITION_PARAM_TYPE *lpt, } if (part_info->first_log_entry && - execute_ddl_log_entry(thd, part_info->first_log_entry->entry_pos)) + ddl_log_execute_entry(thd, part_info->first_log_entry->entry_pos)) { /* We couldn't recover from error, most likely manual interaction diff --git a/sql/sql_partition_admin.cc b/sql/sql_partition_admin.cc index 48ddac257a4..18c53a7e2fb 100644 --- a/sql/sql_partition_admin.cc +++ b/sql/sql_partition_admin.cc @@ -372,12 +372,12 @@ static bool exchange_name_with_ddl_log(THD *thd, */ DBUG_EXECUTE_IF("exchange_partition_fail_1", goto err_no_action_written;); DBUG_EXECUTE_IF("exchange_partition_abort_1", DBUG_SUICIDE();); - if (unlikely(write_ddl_log_entry(&exchange_entry, &log_entry))) + if (unlikely(ddl_log_write_entry(&exchange_entry, &log_entry))) goto err_no_action_written; DBUG_EXECUTE_IF("exchange_partition_fail_2", goto err_no_execute_written;); DBUG_EXECUTE_IF("exchange_partition_abort_2", DBUG_SUICIDE();); - if (unlikely(write_execute_ddl_log_entry(log_entry->entry_pos, FALSE, + if (unlikely(ddl_log_write_execute_entry(log_entry->entry_pos, FALSE, &exec_log_entry))) goto err_no_execute_written; /* ddl_log is written and synced */ @@ -404,7 +404,7 @@ static bool exchange_name_with_ddl_log(THD *thd, } DBUG_EXECUTE_IF("exchange_partition_fail_4", goto err_rename;); DBUG_EXECUTE_IF("exchange_partition_abort_4", DBUG_SUICIDE();); - if (unlikely(deactivate_ddl_log_entry(log_entry->entry_pos))) + if (unlikely(ddl_log_increment_phase(log_entry->entry_pos))) goto err_rename; /* call rename table from partition to table */ @@ -421,7 +421,7 @@ static bool exchange_name_with_ddl_log(THD *thd, } DBUG_EXECUTE_IF("exchange_partition_fail_6", goto err_rename;); DBUG_EXECUTE_IF("exchange_partition_abort_6", DBUG_SUICIDE();); - if (unlikely(deactivate_ddl_log_entry(log_entry->entry_pos))) + if (unlikely(ddl_log_increment_phase(log_entry->entry_pos))) goto err_rename; /* call rename table from tmp-nam to partition */ @@ -438,7 +438,7 @@ static bool exchange_name_with_ddl_log(THD *thd, } DBUG_EXECUTE_IF("exchange_partition_fail_8", goto err_rename;); DBUG_EXECUTE_IF("exchange_partition_abort_8", DBUG_SUICIDE();); - if (unlikely(deactivate_ddl_log_entry(log_entry->entry_pos))) + if (unlikely(ddl_log_increment_phase(log_entry->entry_pos))) goto err_rename; /* The exchange is complete and ddl_log is deactivated */ @@ -454,15 +454,15 @@ err_rename: will log to the error log about the failures... */ /* execute the ddl log entry to revert the renames */ - (void) execute_ddl_log_entry(current_thd, log_entry->entry_pos); + (void) ddl_log_execute_entry(current_thd, log_entry->entry_pos); mysql_mutex_lock(&LOCK_gdl); /* mark the execute log entry done */ - (void) write_execute_ddl_log_entry(0, TRUE, &exec_log_entry); + (void) ddl_log_write_execute_entry(0, TRUE, &exec_log_entry); /* release the execute log entry */ - (void) release_ddl_log_memory_entry(exec_log_entry); + (void) ddl_log_release_memory_entry(exec_log_entry); err_no_execute_written: /* release the action log entry */ - (void) release_ddl_log_memory_entry(log_entry); + (void) ddl_log_release_memory_entry(log_entry); err_no_action_written: mysql_mutex_unlock(&LOCK_gdl); delete file; diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 959dd617ffa..3742cfbb0e9 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -768,8 +768,8 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags) #ifdef WITH_PARTITION_STORAGE_ENGINE lpt->table->file->ha_create_partitioning_metadata(path, shadow_path, CHF_DELETE_FLAG) || - deactivate_ddl_log_entry(part_info->frm_log_entry->entry_pos) || - (sync_ddl_log(), FALSE) || + ddl_log_increment_phase(part_info->frm_log_entry->entry_pos) || + (ddl_log_sync(), FALSE) || mysql_file_rename(key_file_frm, shadow_frm_name, frm_name, MYF(MY_WME)) || lpt->table->file->ha_create_partitioning_metadata(path, shadow_path, @@ -816,9 +816,9 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags) err: #ifdef WITH_PARTITION_STORAGE_ENGINE - deactivate_ddl_log_entry(part_info->frm_log_entry->entry_pos); + ddl_log_increment_phase(part_info->frm_log_entry->entry_pos); part_info->frm_log_entry= NULL; - (void) sync_ddl_log(); + (void) ddl_log_sync(); #endif ; } |