diff options
author | unknown <tomas@poseidon.ndb.mysql.com> | 2006-04-24 18:26:30 +0200 |
---|---|---|
committer | unknown <tomas@poseidon.ndb.mysql.com> | 2006-04-24 18:26:30 +0200 |
commit | 8b308fbbc53cd7d476c42d1a753db75aa2af2e65 (patch) | |
tree | 63ec5a5711acbef541170ceee0362dc3443d5a51 /sql/sql_tablespace.cc | |
parent | 0ba08ecf787a095534cbae4a4f93dd5c028b681f (diff) | |
download | mariadb-git-8b308fbbc53cd7d476c42d1a753db75aa2af2e65.tar.gz |
bug#18604 create logfile for MyISAM tables
- changed alter tablespace truct to work with handlerton pointer (to avoid crash in parser on unknown db type"
- pushed warnings when default storage engine is used and/or tablespace stuff is not supported by storage engine
mysql-test/r/ndb_dd_basic.result:
bug#18604 create logfile for MyISAM tables
mysql-test/t/ndb_dd_basic.test:
bug#18604 create logfile for MyISAM tables
Diffstat (limited to 'sql/sql_tablespace.cc')
-rw-r--r-- | sql/sql_tablespace.cc | 51 |
1 files changed, 35 insertions, 16 deletions
diff --git a/sql/sql_tablespace.cc b/sql/sql_tablespace.cc index e7f6b04045e..8bc39ec82c6 100644 --- a/sql/sql_tablespace.cc +++ b/sql/sql_tablespace.cc @@ -21,32 +21,51 @@ int mysql_alter_tablespace(THD *thd, st_alter_tablespace *ts_info) { int error= HA_ADMIN_NOT_IMPLEMENTED; - handlerton *hton; + const handlerton *hton= ts_info->storage_engine; DBUG_ENTER("mysql_alter_tablespace"); /* If the user haven't defined an engine, this will fallback to using the default storage engine. */ - hton= ha_resolve_by_legacy_type(thd, ts_info->storage_engine != DB_TYPE_UNKNOWN ? - ts_info->storage_engine : DB_TYPE_DEFAULT); + if (hton == NULL || hton == &default_hton || hton->state != SHOW_OPTION_YES) + { + hton= ha_resolve_by_legacy_type(thd, DB_TYPE_DEFAULT); + if (ts_info->storage_engine != 0) + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, + ER_WARN_USING_OTHER_HANDLER, + ER(ER_WARN_USING_OTHER_HANDLER), + hton->name, + ts_info->tablespace_name + ? ts_info->tablespace_name : ts_info->logfile_group_name); + } - if (hton->state == SHOW_OPTION_YES && - hton->alter_tablespace && (error= hton->alter_tablespace(thd, ts_info))) + if (hton->alter_tablespace) { - if (error == HA_ADMIN_NOT_IMPLEMENTED) - { - my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), ""); - } - else if (error == 1) + if ((error= hton->alter_tablespace(thd, ts_info))) { - DBUG_RETURN(1); + if (error == HA_ADMIN_NOT_IMPLEMENTED) + { + my_error(ER_CHECK_NOT_IMPLEMENTED, MYF(0), ""); + } + else if (error == 1) + { + DBUG_RETURN(1); + } + else + { + my_error(error, MYF(0)); + } + DBUG_RETURN(error); } - else - { - my_error(error, MYF(0)); - } - DBUG_RETURN(error); + } + else + { + push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR, + ER_ILLEGAL_HA_CREATE_OPTION, + ER(ER_ILLEGAL_HA_CREATE_OPTION), + hton->name, + "TABLESPACE or LOGFILE GROUP"); } if (mysql_bin_log.is_open()) { |