20 #include "sql_tablespace.h"
21 #include "sql_table.h"
22 #include "sql_class.h"
26 int error= HA_ADMIN_NOT_IMPLEMENTED;
29 DBUG_ENTER(
"mysql_alter_tablespace");
34 if (hton == NULL || hton->state != SHOW_OPTION_YES)
37 if (ts_info->storage_engine != 0)
38 push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
39 ER_WARN_USING_OTHER_HANDLER,
40 ER(ER_WARN_USING_OTHER_HANDLER),
41 ha_resolve_storage_engine_name(hton),
42 ts_info->tablespace_name ? ts_info->tablespace_name
43 : ts_info->logfile_group_name);
46 if (hton->alter_tablespace)
48 if ((error= hton->alter_tablespace(hton, thd, ts_info)))
50 if (error == HA_ADMIN_NOT_IMPLEMENTED)
52 my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0),
"");
60 my_error(error, MYF(0));
67 my_error(ER_ILLEGAL_HA_CREATE_OPTION, MYF(0),
68 ha_resolve_storage_engine_name(hton),
69 "TABLESPACE or LOGFILE GROUP");
70 DBUG_RETURN(HA_ADMIN_NOT_IMPLEMENTED);
72 error= write_bin_log(thd, FALSE, thd->query(), thd->query_length());