Commit 1c5d585b authored by Magnus Blåudd's avatar Magnus Blåudd

Bug#60111 storage type for table not saved in .frm

 (aka BUG#11766883)
  - fix review comments
  - Rewrite last usage of handler::get_tablespace_name to use
    table->s->tablespace directly
  - Remove(revert) the addition of default implementation for
    handler::get_tablespace_name
  - Add comments describing the new TABLE_SHARE members default_storage_media
    and tablespace
  - Fix usage of incorrect mask for column_format bits, i.e COLUMN_FORMAT_MASK
parent 0be575b7
......@@ -3616,22 +3616,6 @@ void handler::get_dynamic_partition_info(PARTITION_STATS *stat_info,
}
char* handler::get_tablespace_name(THD *thd, char *buff, uint buff_len)
{
char *ts= table->s->tablespace;
if (!ts)
return NULL;
if (!buff)
{
buff= my_strdup(ts, MYF(0));
return buff;
}
strnmov(buff, ts, buff_len);
return buff;
}
/****************************************************************************
** Some general functions that isn't in the handler class
****************************************************************************/
......
......@@ -1646,7 +1646,8 @@ public:
{ return FALSE; }
virtual char* get_foreign_key_create_info()
{ return(NULL);} /* gets foreign key create string from InnoDB */
virtual char* get_tablespace_name(THD *thd, char *name, uint name_len);
virtual char* get_tablespace_name(THD *thd, char *name, uint name_len)
{ return(NULL);} /* gets tablespace name from handler */
/** used in ALTER TABLE; 1 if changing storage engine is allowed */
virtual bool can_switch_engines() { return 1; }
/**
......
......@@ -5503,12 +5503,9 @@ static void store_schema_partitions_record(THD *thd, TABLE *schema_table,
strlen(part_elem->tablespace_name), cs);
else
{
char *ts= showing_table->file->get_tablespace_name(thd,0,0);
char *ts= showing_table->s->tablespace;
if(ts)
{
table->field[24]->store(ts, strlen(ts), cs);
my_free(ts);
}
else
table->field[24]->set_null();
}
......
......@@ -1489,7 +1489,7 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
const uchar field_flags= format_section_fields[i];
const uchar field_storage= (field_flags & STORAGE_TYPE_MASK);
const uchar field_column_format=
((field_flags >> COLUMN_FORMAT_SHIFT)& STORAGE_TYPE_MASK);
((field_flags >> COLUMN_FORMAT_SHIFT)& COLUMN_FORMAT_MASK);
DBUG_PRINT("debug", ("field flags: %u, storage: %u, column_format: %u",
field_flags, field_storage, field_column_format));
(void)field_storage; /* Reserved by and used in MySQL Cluster */
......
......@@ -609,8 +609,6 @@ 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;
char *tablespace;
uint ref_count; /* How many TABLE objects uses this */
uint blob_ptr_size; /* 4 or 8 */
......@@ -653,6 +651,16 @@ struct TABLE_SHARE
*/
int cached_row_logging_check;
/*
Storage media to use for this table (unless another storage
media has been specified on an individual column - in versions
where that is supported)
*/
enum ha_storage_media default_storage_media;
/* Name of the tablespace used for this table */
char *tablespace;
#ifdef WITH_PARTITION_STORAGE_ENGINE
/* filled in when reading from frm */
bool auto_partitioned;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment