mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Bug #5539 SHOW DATABASES LIKE and symlinks
sql_show.cc: Made change suggested by Serge. REmoved else in mysql_find_files so symlink files fall through to the wildcard check
This commit is contained in:
@ -193,28 +193,23 @@ mysql_find_files(THD *thd,List<char> *files, const char *db,const char *path,
|
|||||||
{ /* Return databases */
|
{ /* Return databases */
|
||||||
#ifdef USE_SYMDIR
|
#ifdef USE_SYMDIR
|
||||||
char *ext;
|
char *ext;
|
||||||
|
char buff[FN_REFLEN];
|
||||||
if (my_use_symdir && !strcmp(ext=fn_ext(file->name), ".sym"))
|
if (my_use_symdir && !strcmp(ext=fn_ext(file->name), ".sym"))
|
||||||
{
|
{
|
||||||
/* Only show the sym file if it points to a directory */
|
/* Only show the sym file if it points to a directory */
|
||||||
char buff[FN_REFLEN], *end;
|
char *end;
|
||||||
MY_STAT status;
|
|
||||||
*ext=0; /* Remove extension */
|
*ext=0; /* Remove extension */
|
||||||
unpack_dirname(buff, file->name);
|
unpack_dirname(buff, file->name);
|
||||||
end= strend(buff);
|
end= strend(buff);
|
||||||
if (end != buff && end[-1] == FN_LIBCHAR)
|
if (end != buff && end[-1] == FN_LIBCHAR)
|
||||||
end[-1]= 0; // Remove end FN_LIBCHAR
|
end[-1]= 0; // Remove end FN_LIBCHAR
|
||||||
if (!my_stat(buff, &status, MYF(0)) ||
|
if (!my_stat(buff, file->mystat, MYF(0)))
|
||||||
!MY_S_ISDIR(status.st_mode) ||
|
continue;
|
||||||
(wild && wild_compare(file->name, wild, 0)))
|
}
|
||||||
continue;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
#endif
|
#endif
|
||||||
{
|
|
||||||
if (file->name[0] == '.' || !MY_S_ISDIR(file->mystat->st_mode) ||
|
if (file->name[0] == '.' || !MY_S_ISDIR(file->mystat->st_mode) ||
|
||||||
(wild && wild_compare(file->name,wild, 0)))
|
(wild && wild_compare(file->name,wild, 0)))
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user