mirror of
https://github.com/MariaDB/server.git
synced 2025-07-27 18:02:13 +03:00
Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.1-new
into linux.site:/home/marty/MySQL/mysql-5.1-new
This commit is contained in:
@ -3701,12 +3701,10 @@ static uint compare_tables(TABLE *table, List<create_field> *create_list,
|
||||
/* Evaluate changes bitmap and send to check_if_incompatible_data() */
|
||||
if (!(tmp= field->is_equal(new_field)))
|
||||
DBUG_RETURN(ALTER_TABLE_DATA_CHANGED);
|
||||
|
||||
// Clear indexed marker
|
||||
field->add_index= 0;
|
||||
changes|= tmp;
|
||||
}
|
||||
/* Check if changes are compatible with current handler without a copy */
|
||||
if (table->file->check_if_incompatible_data(create_info, changes))
|
||||
DBUG_RETURN(ALTER_TABLE_DATA_CHANGED);
|
||||
|
||||
/*
|
||||
Go through keys and check if the original ones are compatible
|
||||
@ -3774,6 +3772,11 @@ static uint compare_tables(TABLE *table, List<create_field> *create_list,
|
||||
/* Key modified. Add the offset of the key to both buffers. */
|
||||
index_drop_buffer[(*index_drop_count)++]= table_key - table->key_info;
|
||||
index_add_buffer[(*index_add_count)++]= new_key - key_info_buffer;
|
||||
field= table->field[new_key->key_part->fieldnr];
|
||||
// Add field to the key
|
||||
new_key->key_part->field= table->field[new_key->key_part->fieldnr];
|
||||
// Mark field to be part of new key
|
||||
field->add_index= 1;
|
||||
DBUG_PRINT("info", ("index changed: '%s'", table_key->name));
|
||||
}
|
||||
/*end of for (; table_key < table_key_end;) */
|
||||
@ -3793,9 +3796,19 @@ static uint compare_tables(TABLE *table, List<create_field> *create_list,
|
||||
{
|
||||
/* Key not found. Add the offset of the key to the add buffer. */
|
||||
index_add_buffer[(*index_add_count)++]= new_key - key_info_buffer;
|
||||
DBUG_PRINT("info", ("index added: '%s'", new_key->name));
|
||||
field= table->field[new_key->key_part->fieldnr];
|
||||
// Add field to the key
|
||||
new_key->key_part->field= table->field[new_key->key_part->fieldnr];
|
||||
// Mark field to be part of new key
|
||||
field->add_index= 1;
|
||||
DBUG_PRINT("info", ("index added: '%s'", new_key->name));
|
||||
}
|
||||
}
|
||||
|
||||
/* Check if changes are compatible with current handler without a copy */
|
||||
if (table->file->check_if_incompatible_data(create_info, changes))
|
||||
DBUG_RETURN(ALTER_TABLE_DATA_CHANGED);
|
||||
|
||||
if (*index_drop_count || *index_add_count)
|
||||
DBUG_RETURN(ALTER_TABLE_INDEX_CHANGED);
|
||||
|
||||
|
Reference in New Issue
Block a user