diff options
author | Sergei Golubchik <sergii@pisem.net> | 2014-03-26 09:32:54 +0100 |
---|---|---|
committer | Sergei Golubchik <sergii@pisem.net> | 2014-03-26 09:32:54 +0100 |
commit | 1b468ca675c4b978f067a443e6cd0b3c14db68cc (patch) | |
tree | 949a17662b32c95de9466071daa8e74f9d4fa8ad /storage/maria | |
parent | f17831fa745cbd47952c6bf7d4a8eeb9195e6b6c (diff) | |
download | mariadb-git-1b468ca675c4b978f067a443e6cd0b3c14db68cc.tar.gz |
MDEV-5815 MySQL BUG#11751736: DROP DATABASE STATEMENT SHOULD REMOVE .OLD SUFFIX FROM DATABASE DIRECTORY
Delete .OLD and .TMD files when a MyISAM table is dropped.
Same for Aria.
sql/sql_db.cc:
dead code - *.TMD cannot be deleted from here.
Diffstat (limited to 'storage/maria')
-rw-r--r-- | storage/maria/ma_delete_table.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/storage/maria/ma_delete_table.c b/storage/maria/ma_delete_table.c index 09d5cde5ad0..56a6dfc8e5f 100644 --- a/storage/maria/ma_delete_table.c +++ b/storage/maria/ma_delete_table.c @@ -92,7 +92,14 @@ int maria_delete_table_files(const char *name, myf sync_dir) MYF(MY_WME | sync_dir))) DBUG_RETURN(my_errno); fn_format(from,name,"",MARIA_NAME_DEXT,MY_UNPACK_FILENAME|MY_APPEND_EXT); - DBUG_RETURN(mysql_file_delete_with_symlink(key_file_dfile, - from, MYF(MY_WME | sync_dir)) ? - my_errno : 0); + if (mysql_file_delete_with_symlink(key_file_dfile, from, + MYF(MY_WME | sync_dir))) + DBUG_RETURN(my_errno); + + // optional files from maria_pack: + fn_format(from,name,"",".TMD",MY_UNPACK_FILENAME|MY_APPEND_EXT); + mysql_file_delete_with_symlink(key_file_dfile, from, MYF(0)); + fn_format(from,name,"",".OLD",MY_UNPACK_FILENAME|MY_APPEND_EXT); + mysql_file_delete_with_symlink(key_file_dfile, from, MYF(0)); + DBUG_RETURN(0); } |