Commit d7511181 authored by Alexey Kopytov's avatar Alexey Kopytov

Fixed the result of a bad merge in storage/myisam/mi_delete_table.c in mysql-trunk-merge.

parent cab4a776
......@@ -19,41 +19,6 @@
#include "fulltext.h"
/**
Remove MyISAM data/index file safely
@details
If name is a symlink and file it is pointing to is not in
data directory, file is also removed.
@param name file to remove
@returns
0 on success or my_errno on failure
*/
static int _mi_safe_delete_file(const char *name)
{
DBUG_ENTER("_mi_safe_delete_file");
if (my_is_symlink(name) && (*myisam_test_invalid_symlink)(name))
{
/*
Symlink is pointing to file in data directory.
Remove symlink, keep file.
*/
if (my_delete(name, MYF(MY_WME)))
DBUG_RETURN(my_errno);
}
else
{
if (my_delete_with_symlink(name, MYF(MY_WME)))
DBUG_RETURN(my_errno);
}
DBUG_RETURN(0);
}
int mi_delete_table(const char *name)
{
char from[FN_REFLEN];
......@@ -107,25 +72,24 @@ int mi_delete_table(const char *name)
if (mysql_file_delete_with_symlink(mi_key_file_kfile, from, MYF(MY_WME)))
DBUG_RETURN(my_errno);
}
DBUG_RETURN(my_errno);
fn_format(from,name,"",MI_NAME_DEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT);
#ifdef USE_RAID
if (raid_type)
DBUG_RETURN(my_raid_delete(from, raid_chunks, MYF(MY_WME)) ? my_errno : 0);
#endif
if (my_is_symlink(from) && (*myisam_test_invalid_symlink)(from))
{
/*
Symlink is pointing to file in data directory.
Remove symlink, keep file.
*/
if (mysql_file_delete(mi_key_file_dfile, from, MYF(MY_WME)))
DBUG_RETURN(my_errno);
}
{
/*
Symlink is pointing to file in data directory.
Remove symlink, keep file.
*/
if (mysql_file_delete(mi_key_file_dfile, from, MYF(MY_WME)))
DBUG_RETURN(my_errno);
}
else
{
if (mysql_file_delete_with_symlink(mi_key_file_dfile, from, MYF(MY_WME)))
DBUG_RETURN(my_errno);
}
{
if (mysql_file_delete_with_symlink(mi_key_file_dfile, from, MYF(MY_WME)))
DBUG_RETURN(my_errno);
}
DBUG_RETURN(0);
}
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