1
/* Copyright (C) 2000-2004 MySQL AB
3
This program is free software; you can redistribute it and/or modify
4
it under the terms of the GNU General Public License as published by
5
the Free Software Foundation; version 2 of the License.
7
This program is distributed in the hope that it will be useful,
8
but WITHOUT ANY WARRANTY; without even the implied warranty of
9
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
16
/* drop and alter of tablespaces */
18
#include "mysql_priv.h"
20
int mysql_alter_tablespace(THD *thd, st_alter_tablespace *ts_info)
22
int error= HA_ADMIN_NOT_IMPLEMENTED;
23
handlerton *hton= ts_info->storage_engine;
25
DBUG_ENTER("mysql_alter_tablespace");
27
If the user haven't defined an engine, this will fallback to using the
28
default storage engine.
30
if (hton == NULL || hton->state != SHOW_OPTION_YES)
32
hton= ha_default_handlerton(thd);
33
if (ts_info->storage_engine != 0)
34
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
35
ER_WARN_USING_OTHER_HANDLER,
36
ER(ER_WARN_USING_OTHER_HANDLER),
37
ha_resolve_storage_engine_name(hton),
38
ts_info->tablespace_name ? ts_info->tablespace_name
39
: ts_info->logfile_group_name);
42
if (hton->alter_tablespace)
44
if ((error= hton->alter_tablespace(hton, thd, ts_info)))
46
if (error == HA_ADMIN_NOT_IMPLEMENTED)
48
my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), "");
56
my_error(error, MYF(0));
63
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
64
ER_ILLEGAL_HA_CREATE_OPTION,
65
ER(ER_ILLEGAL_HA_CREATE_OPTION),
66
ha_resolve_storage_engine_name(hton),
67
"TABLESPACE or LOGFILE GROUP");
69
error= write_bin_log(thd, FALSE, thd->query(), thd->query_length());