Commit 2b432383 authored by unknown's avatar unknown

Bug#24667 After ALTER TABLE operation ndb_dd table becomes regular ndb, Bug...

Bug#24667  After ALTER TABLE operation ndb_dd table becomes regular ndb, Bug #25296  Truncate table converts NDB disk based tables to in-memory tables: Check table storage before creating columns


sql/ha_ndbcluster.cc:
  #24667  After ALTER TABLE operation ndb_dd table becomes regular ndb, Bug #25296  Truncate table converts NDB disk based tables to in-memory tables: Check table storage before creating columns
parent 07b2d9e5
......@@ -4962,6 +4962,29 @@ int ha_ndbcluster::create(const char *name,
my_free((char*)data, MYF(0));
my_free((char*)pack_data, MYF(0));
if (create_info->storage_media == HA_SM_DISK)
{
if (create_info->tablespace)
tab.setTablespaceName(create_info->tablespace);
else
tab.setTablespaceName("DEFAULT-TS");
}
else if (create_info->tablespace)
{
if (create_info->storage_media == HA_SM_MEMORY)
{
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
ER_ILLEGAL_HA_CREATE_OPTION,
ER(ER_ILLEGAL_HA_CREATE_OPTION),
ndbcluster_hton_name,
"TABLESPACE currently only supported for "
"STORAGE DISK");
DBUG_RETURN(HA_ERR_UNSUPPORTED);
}
tab.setTablespaceName(create_info->tablespace);
create_info->storage_media = HA_SM_DISK; //if use tablespace, that also means store on disk
}
for (i= 0; i < form->s->fields; i++)
{
Field *field= form->field[i];
......@@ -4995,29 +5018,6 @@ int ha_ndbcluster::create(const char *name,
NdbDictionary::Column::StorageTypeMemory);
}
if (create_info->storage_media == HA_SM_DISK)
{
if (create_info->tablespace)
tab.setTablespaceName(create_info->tablespace);
else
tab.setTablespaceName("DEFAULT-TS");
}
else if (create_info->tablespace)
{
if (create_info->storage_media == HA_SM_MEMORY)
{
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_ERROR,
ER_ILLEGAL_HA_CREATE_OPTION,
ER(ER_ILLEGAL_HA_CREATE_OPTION),
ndbcluster_hton_name,
"TABLESPACE currently only supported for "
"STORAGE DISK");
DBUG_RETURN(HA_ERR_UNSUPPORTED);
}
tab.setTablespaceName(create_info->tablespace);
create_info->storage_media = HA_SM_DISK; //if use tablespace, that also means store on disk
}
// No primary key, create shadow key as 64 bit, auto increment
if (form->s->primary_key == MAX_KEY)
{
......
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