Commit 0d7db464 authored by Sergei Golubchik's avatar Sergei Golubchik

pos-fixes for rename

parent 1108f81e
...@@ -344,8 +344,8 @@ t1#i#01.MYI ...@@ -344,8 +344,8 @@ t1#i#01.MYI
t1.MYD t1.MYD
t1.MYI t1.MYI
t1.frm t1.frm
rename table test1.t2 to test1.t1; rename table test1.t1 to test1.t2;
ERROR 42S02: Table 'test1.t2' doesn't exist ERROR HY000: Error on rename of './test1/t1#i#01.MYD' to './test1/t2#i#01.MYD' (Errcode: 2 "No such file or directory")
db.opt db.opt
t1#i#01.MYI t1#i#01.MYI
t1.MYD t1.MYD
......
...@@ -132,8 +132,8 @@ rename table test.t2 to test1.t1; ...@@ -132,8 +132,8 @@ rename table test.t2 to test1.t1;
list_files $datadir/test1; list_files $datadir/test1;
remove_file $datadir/test1/t1#i#01.MYD; remove_file $datadir/test1/t1#i#01.MYD;
--error ER_NO_SUCH_TABLE --error 7
rename table test1.t2 to test1.t1; rename table test1.t1 to test1.t2;
list_files $datadir/test1; list_files $datadir/test1;
drop database test1; drop database test1;
list_files $datadir/test; list_files $datadir/test;
...@@ -5388,6 +5388,7 @@ mysql_rename_table(handlerton *base, const LEX_CSTRING *old_db, ...@@ -5388,6 +5388,7 @@ mysql_rename_table(handlerton *base, const LEX_CSTRING *old_db,
} }
file->ha_rename_table(to_base, from_base); file->ha_rename_table(to_base, from_base);
rename_file_ext(to, from, reg_ext); rename_file_ext(to, from, reg_ext);
break;
} }
} }
} }
......
...@@ -36,10 +36,8 @@ int mi_rename(const char *old_name, const char *new_name) ...@@ -36,10 +36,8 @@ int mi_rename(const char *old_name, const char *new_name)
save_errno= my_errno; save_errno= my_errno;
fn_format(from,old_name,"",MI_NAME_DEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT); fn_format(from,old_name,"",MI_NAME_DEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT);
fn_format(to,new_name,"",MI_NAME_DEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT); fn_format(to,new_name,"",MI_NAME_DEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT);
if (mysql_file_rename_with_symlink(mi_key_file_dfile, if (mysql_file_rename_with_symlink(mi_key_file_dfile, from, to, MYF(MY_WME)))
from, to, if (!save_errno)
MYF(MY_WME)))
if (save_errno)
save_errno= my_errno; save_errno= my_errno;
DBUG_RETURN(save_errno); DBUG_RETURN(save_errno);
} }
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