summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorMagnus Blåudd <magnus.blaudd@oracle.com>2011-03-25 15:03:44 +0100
committerMagnus Blåudd <magnus.blaudd@oracle.com>2011-03-25 15:03:44 +0100
commitab33d3ef2b1f7721541e85f8f1d8962accc2d624 (patch)
tree976ede0a9523cae2ebc57d967e3975cb9ff91ddf /sql/sql_table.cc
parent52a01765bd9410ac13ca3bf2d163594eb40cbd53 (diff)
parent3d8d67245051f489c3702e35a3201e092da28a88 (diff)
downloadmariadb-git-ab33d3ef2b1f7721541e85f8f1d8962accc2d624.tar.gz
Merge
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r--sql/sql_table.cc17
1 files changed, 6 insertions, 11 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 677d2095a77..ce4218869ff 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -5281,17 +5281,12 @@ mysql_prepare_alter_table(THD *thd, TABLE *table,
if (!(used_fields & HA_CREATE_USED_KEY_BLOCK_SIZE))
create_info->key_block_size= table->s->key_block_size;
- if (!create_info->tablespace && create_info->storage_media != HA_SM_MEMORY)
- {
- char *tablespace= static_cast<char *>(thd->alloc(FN_LEN + 1));
- /*
- Regular alter table of disk stored table (no tablespace/storage change)
- Copy tablespace name
- */
- if (tablespace &&
- (table->file->get_tablespace_name(thd, tablespace, FN_LEN)))
- create_info->tablespace= tablespace;
- }
+ if (!create_info->tablespace)
+ create_info->tablespace= table->s->tablespace;
+
+ if (create_info->storage_media == HA_SM_DEFAULT)
+ create_info->storage_media= table->s->default_storage_media;
+
restore_record(table, s->default_values); // Empty record for DEFAULT
Create_field *def;