diff options
author | acurtis@xiphis.org <> | 2006-05-09 13:31:46 -0700 |
---|---|---|
committer | acurtis@xiphis.org <> | 2006-05-09 13:31:46 -0700 |
commit | 47e89f208a25652ec93529eb7dc4944ec5a73659 (patch) | |
tree | 1fed1caed61ab2e91c6c91ac94cad060494a7492 /sql/sql_table.cc | |
parent | ec4211923320e398b3ebdef4fdde7f55fe93dd55 (diff) | |
download | mariadb-git-47e89f208a25652ec93529eb7dc4944ec5a73659.tar.gz |
bug#10952
"alter table from MyISAM to MERGE lost data without errors and warnings"
Add new handlerton flag which prevent user from altering table storage
engine to storage engines which would lose data. Both 'blackhole' and
'merge' are marked with the new flag.
Tests included.
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 7b739798b38..805c7c1edc0 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -3313,7 +3313,9 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, DBUG_PRINT("info", ("old type: %d new type: %d", old_db_type, new_db_type)); if (ha_check_storage_engine_flag(old_db_type, HTON_ALTER_NOT_SUPPORTED) || - ha_check_storage_engine_flag(new_db_type, HTON_ALTER_NOT_SUPPORTED)) + ha_check_storage_engine_flag(new_db_type, HTON_ALTER_NOT_SUPPORTED) || + (old_db_type != new_db_type && + ha_check_storage_engine_flag(new_db_type, HTON_ALTER_CANNOT_CREATE))) { DBUG_PRINT("info", ("doesn't support alter")); my_error(ER_ILLEGAL_HA, MYF(0), table_name); |