summaryrefslogtreecommitdiff
path: root/sql/sql_table.cc
diff options
context:
space:
mode:
authorMagnus Blåudd <magnus.blaudd@oracle.com>2011-03-04 09:41:29 +0100
committerMagnus Blåudd <magnus.blaudd@oracle.com>2011-03-04 09:41:29 +0100
commit0be575b7c8a7d551e7b0ea011b715f5e808e2eab (patch)
tree91078f8e09a7d3bf446e8c6c1896bde1a0a20ad7 /sql/sql_table.cc
parentd1d166875ac2eec18d15611d0d82ba49b6def288 (diff)
downloadmariadb-git-0be575b7c8a7d551e7b0ea011b715f5e808e2eab.tar.gz
Bug#60111 storage type for table not saved in .frm
- Add new "format section" in extra data segment with additional table and column properties. This was originally introduced in 5.1.20 based MySQL Cluster - Remove hardcoded STORAGE DISK for table and instead output the real storage format used. Keep both TABLESPACE and STORAGE inside same version guard. - Implement default version of handler::get_tablespace_name() since tablespace is now available in share and it's unnecessary for each handler to implement. (the function could actually be removed totally now). - Add test for combinations of TABLESPACE and STORAGE with CREATE TABLE and ALTER TABLE - Add test to show that 5.5 now can read a .frm file created by MySQL Cluster 7.0.22. Although it does not yet show the column level attributes, they are read.
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 2855bb0ec4a..21b8b5bf0a0 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;