1/*
2 Copyright (c) 2000, 2010, Oracle and/or its affiliates
3
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; version 2 of the License.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
16
17/*
18 deletes a table
19*/
20
21#include "fulltext.h"
22
23#ifndef HAVE_PSI_INTERFACE
24#define PSI_file_key int
25#define mi_key_file_kfile 0
26#define mi_key_file_dfile 0
27#endif
28
29int mi_delete_table(const char *name)
30{
31 DBUG_ENTER("mi_delete_table");
32
33#ifdef EXTRA_DEBUG
34 check_table_is_closed(name,"delete");
35#endif
36
37 if (mysql_file_delete_with_symlink(mi_key_file_kfile, name, MI_NAME_IEXT, MYF(MY_WME)) ||
38 mysql_file_delete_with_symlink(mi_key_file_dfile, name, MI_NAME_DEXT, MYF(MY_WME)))
39 DBUG_RETURN(my_errno);
40
41 // optionally present:
42 mysql_file_delete_with_symlink(mi_key_file_dfile, name, ".OLD", MYF(0));
43 mysql_file_delete_with_symlink(mi_key_file_dfile, name, ".TMD", MYF(0));
44
45 DBUG_RETURN(0);
46}
47