#At file:///home/msvensson/mysql/5.5-frm_fixes/ based on revid:magnus.blaudd@strippedvohd0
3319 Magnus Blåudd 2011-02-11
Bug#60111 storage type for table not saved in .frm
- Extract the two bits indicating whith storage media the table should be using
from create_info after reading that from .frm file.
- Add TABLE_SHARE::default_storage_media
- Add output about the storage format for a table to SHOW CREATE TABLE
modified:
sql/sql_show.cc
sql/table.cc
sql/table.h
=== modified file 'sql/sql_show.cc'
--- a/sql/sql_show.cc 2011-02-08 15:47:33 +0000
+++ b/sql/sql_show.cc 2011-02-11 10:23:25 +0000
@@ -1388,10 +1388,21 @@ int store_create_info(THD *thd, TABLE_LI
{
packet->append(STRING_WITH_LEN(" /*!50100 TABLESPACE "));
packet->append(for_str, strlen(for_str));
- packet->append(STRING_WITH_LEN(" STORAGE DISK */"));
+ packet->append(STRING_WITH_LEN(" */"));
my_free(for_str);
}
+ switch (table->s->default_storage_media) {
+ case(HA_SM_DEFAULT):
+ break;
+ case(HA_SM_DISK):
+ packet->append(STRING_WITH_LEN(" /*!50100 STORAGE DISK */"));
+ break;
+ case(HA_SM_MEMORY):
+ packet->append(STRING_WITH_LEN(" /*!50100 STORAGE MEMORY */"));
+ break;
+ };
+
/*
IF check_create_info
THEN add ENGINE only if it was used when creating the table
=== modified file 'sql/table.cc'
--- a/sql/table.cc 2011-02-11 10:11:58 +0000
+++ b/sql/table.cc 2011-02-11 10:23:25 +0000
@@ -794,6 +794,8 @@ static int open_binary_frm(THD *thd, TAB
ha_checktype(thd, legacy_db_type, 0, 0));
share->db_create_options= db_create_options= uint2korr(head+30);
share->db_options_in_use= share->db_create_options;
+ share->default_storage_media=
+ (ha_storage_media)((db_create_options >> HA_OPTION_STORAGE_SHIFT) & 3);
share->mysql_version= uint4korr(head+51);
share->null_field_first= 0;
if (!head[32]) // New frm file in 3.23
@@ -2689,6 +2691,7 @@ void update_create_info_from_table(HA_CR
create_info->default_table_charset= share->table_charset;
create_info->table_charset= 0;
create_info->comment= share->comment;
+ create_info->storage_media = share->default_storage_media;
DBUG_VOID_RETURN;
}
=== modified file 'sql/table.h'
--- a/sql/table.h 2010-12-29 00:26:31 +0000
+++ b/sql/table.h 2011-02-11 10:23:25 +0000
@@ -609,6 +609,7 @@ struct TABLE_SHARE
}
enum row_type row_type; /* How rows are stored */
enum tmp_table_type tmp_table;
+ enum ha_storage_media default_storage_media;
uint ref_count; /* How many TABLE objects uses this */
uint blob_ptr_size; /* 4 or 8 */
Attachment: [text/bzr-bundle] bzr/magnus.blaudd@oracle.com-20110211102325-ibma42hw4gap9ad2.bundle
| Thread |
|---|
| • bzr commit into mysql-5.5 branch (magnus.blaudd:3319) Bug#60111 | Magnus Blåudd | 11 Feb |