mirror of
https://github.com/MariaDB/server.git
synced 2025-01-20 05:52:27 +01:00
Fixed the result of a bad merge in storage/myisam/mi_delete_table.c in mysql-trunk-merge.
This commit is contained in:
parent
cab4a776d8
commit
d7511181c5
1 changed files with 12 additions and 48 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue