Commit 6db06b61 authored by unknown's avatar unknown

BUG#25877, After DROP INDEX non-indexed data isn't moved from memory into tablespace


sql/ha_ndbcluster.cc:
  add/drop index online will change storage media type, 
  so add storage type check in check_if_incompatible_data(),
  when storage type is changed, will create a new table,
  then this can correct the column and table's storage type.
parent dec21095
......@@ -10606,10 +10606,23 @@ bool ha_ndbcluster::check_if_incompatible_data(HA_CREATE_INFO *create_info,
int pk= 0;
int ai= 0;
if (create_info->tablespace)
create_info->storage_media = HA_SM_DISK;
else
create_info->storage_media = HA_SM_MEMORY;
for (i= 0; i < table->s->fields; i++)
{
Field *field= table->field[i];
const NDBCOL *col= tab->getColumn(i);
if (col->getStorageType() == NDB_STORAGETYPE_MEMORY && create_info->storage_media != HA_SM_MEMORY ||
col->getStorageType() == NDB_STORAGETYPE_DISK && create_info->storage_media != HA_SM_DISK)
{
DBUG_PRINT("info", ("Column storage media is changed"));
DBUG_RETURN(COMPATIBLE_DATA_NO);
}
if (field->flags & FIELD_IS_RENAMED)
{
DBUG_PRINT("info", ("Field has been renamed, copy table"));
......
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