summaryrefslogtreecommitdiff
path: root/sql/handler.cc
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2017-02-20 22:40:47 +0100
committerSergei Golubchik <serg@mariadb.org>2017-02-27 12:35:10 +0100
commitd72dbb41229ceb6434ecd3e23d559bb7b39dd15f (patch)
treefab72e0fca0e0b1d8d29ebfa13b6c21c5df10430 /sql/handler.cc
parent955f2f036d6252b90e2bffcec521dd4a7db0a30a (diff)
downloadmariadb-git-d72dbb41229ceb6434ecd3e23d559bb7b39dd15f.tar.gz
bugfix: remove my_delete_with_symlink()
it was race condition prone. instead use either a pair of my_delete() calls with already resolved paths, or a safe high-level function my_handler_delete_with_symlink(), like MyISAM and Aria already do.
Diffstat (limited to 'sql/handler.cc')
-rw-r--r--sql/handler.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index cef3f098161..2ae144a86cc 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -3378,12 +3378,10 @@ int handler::delete_table(const char *name)
int saved_error= 0;
int error= 0;
int enoent_or_zero= ENOENT; // Error if no file was deleted
- char buff[FN_REFLEN];
for (const char **ext=bas_ext(); *ext ; ext++)
{
- fn_format(buff, name, "", *ext, MY_UNPACK_FILENAME|MY_APPEND_EXT);
- if (mysql_file_delete_with_symlink(key_file_misc, buff, MYF(0)))
+ if (my_handler_delete_with_symlink(key_file_misc, name, *ext, 0))
{
if (my_errno != ENOENT)
{