1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

cleanup of ha_myisam::deactivate_non_unique_index() and Co.

This commit is contained in:
unknown
2004-04-02 20:42:35 +02:00
parent 7c27065c3e
commit a66fe8dcd5
6 changed files with 26 additions and 37 deletions

View File

@ -3966,18 +3966,18 @@ static my_bool mi_too_big_key_for_sort(MI_KEYDEF *key, ha_rows rows)
void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows)
{
MYISAM_SHARE *share=info->s;
uint i;
if (!info->state->records) /* Don't do this if old rows */
MI_KEYDEF *key=share->keyinfo;
uint i;
DBUG_ASSERT(info->state->records == 0 &&
(!rows || rows >= MI_MIN_ROWS_TO_DISABLE_INDEXES));
for (i=0 ; i < share->base.keys ; i++,key++)
{
MI_KEYDEF *key=share->keyinfo;
for (i=0 ; i < share->base.keys ; i++,key++)
if (!(key->flag & (HA_NOSAME | HA_SPATIAL | HA_AUTO_KEY)) &&
! mi_too_big_key_for_sort(key,rows) && info->s->base.auto_key != i+1)
{
if (!(key->flag & (HA_NOSAME | HA_SPATIAL | HA_AUTO_KEY)) &&
! mi_too_big_key_for_sort(key,rows) && info->s->base.auto_key != i+1)
{
share->state.key_map&= ~ ((ulonglong) 1 << i);
info->update|= HA_STATE_CHANGED;
}
share->state.key_map&= ~ ((ulonglong) 1 << i);
info->update|= HA_STATE_CHANGED;
}
}
}