Commit c859f941 authored by Aleksey Midenkov's avatar Aleksey Midenkov

Fix shadow frm log entry

parent 714f5eb3
...@@ -479,7 +479,7 @@ int TABLE_SHARE::fk_write_shadow_frm_impl(const char *shadow_path) ...@@ -479,7 +479,7 @@ int TABLE_SHARE::fk_write_shadow_frm_impl(const char *shadow_path)
} }
bool ddl_log_info::write_log_replace_delete_frm(const char *from_path, bool ddl_log_info::write_log_replace_delete_file(const char *from_path,
const char *to_path, const char *to_path,
bool replace_flag) bool replace_flag)
{ {
...@@ -520,11 +520,13 @@ bool ddl_log_info::write_log_replace_delete_frm(const char *from_path, ...@@ -520,11 +520,13 @@ bool ddl_log_info::write_log_replace_delete_frm(const char *from_path,
int FK_backup::fk_write_shadow_frm(ddl_log_info &log_info) int FK_backup::fk_write_shadow_frm(ddl_log_info &log_info)
{ {
char shadow_path[FN_REFLEN + 1]; char shadow_path[FN_REFLEN + 1];
char frm_name[FN_REFLEN + 1];
TABLE_SHARE *s= get_share(); TABLE_SHARE *s= get_share();
DBUG_ASSERT(s); DBUG_ASSERT(s);
build_table_shadow_filename(shadow_path, sizeof(shadow_path) - 1, build_table_shadow_filename(shadow_path, sizeof(shadow_path) - 1,
s->db, s->table_name, tmp_fk_prefix); s->db, s->table_name, tmp_fk_prefix);
if (log_info.write_log_replace_delete_frm(NULL, shadow_path, false)) strxnmov(frm_name, sizeof(frm_name), shadow_path, reg_ext, NullS);
if (log_info.write_log_replace_delete_file(NULL, frm_name, false))
return true; return true;
delete_shadow_entry= log_info.first_entry; delete_shadow_entry= log_info.first_entry;
int err= s->fk_write_shadow_frm_impl(shadow_path); int err= s->fk_write_shadow_frm_impl(shadow_path);
...@@ -551,7 +553,7 @@ bool FK_backup::fk_backup_frm(ddl_log_info &log_info) ...@@ -551,7 +553,7 @@ bool FK_backup::fk_backup_frm(ddl_log_info &log_info)
my_error(ER_FILE_EXISTS_ERROR, MYF(0), bak_name); my_error(ER_FILE_EXISTS_ERROR, MYF(0), bak_name);
return true; return true;
} }
if (log_info.write_log_replace_delete_frm(bak_name, frm_name, true)) if (log_info.write_log_replace_delete_file(bak_name, frm_name, true))
return true; return true;
restore_backup_entry= log_info.first_entry; restore_backup_entry= log_info.first_entry;
#ifndef DBUG_OFF #ifndef DBUG_OFF
......
...@@ -923,7 +923,7 @@ struct ddl_log_info ...@@ -923,7 +923,7 @@ struct ddl_log_info
DBUG_ASSERT(!first_entry); DBUG_ASSERT(!first_entry);
} }
void release(); void release();
bool write_log_replace_delete_frm(const char *from_path, const char *to_path, bool write_log_replace_delete_file(const char *from_path, const char *to_path,
bool replace_flag); bool replace_flag);
void write_log_finish(); void write_log_finish();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment