1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-01 03:47:19 +03:00

DROP DATABASE with symlinks did not work before

This commit is contained in:
Sinisa@sinisa.nasamreza.org
2002-05-14 14:42:03 +03:00
parent 3facae335e
commit 24b2d57f9c
2 changed files with 10 additions and 1 deletions

View File

@ -46771,6 +46771,8 @@ Our TODO section contains what we plan to have in 4.0. @xref{TODO MySQL 4.0}.
@itemize @bullet @itemize @bullet
@item @item
Fixed bug in DROP DATABASE with symlink
@item
Multi-table @code{DELETE}. Multi-table @code{DELETE}.
@item @item
Don't support old client protocols prior to MySQL 3.21 any more. Don't support old client protocols prior to MySQL 3.21 any more.

View File

@ -271,9 +271,16 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *org_path,
*/ */
if (!found_other_files) if (!found_other_files)
{ {
char tmp_path[FN_REFLEN]; char tmp_path[FN_REFLEN], lnk_path[FN_REFLEN];
char *path=unpack_filename(tmp_path,org_path); char *path=unpack_filename(tmp_path,org_path);
#ifdef HAVE_READLINK #ifdef HAVE_READLINK
if (path[0] == FN_CURLIB)
{
int length = (strxmov(lnk_path,curr_dir,path + 2, NullS) - lnk_path) - 1;
path=lnk_path;
if (path[length] == FN_LIBCHAR)
path[length]='\0';
}
int linkcount = readlink(path,filePath,sizeof(filePath)-1); int linkcount = readlink(path,filePath,sizeof(filePath)-1);
if (linkcount > 0) // If the path was a symbolic link if (linkcount > 0) // If the path was a symbolic link
{ {