summaryrefslogtreecommitdiff
path: root/myisam/mi_extra.c
diff options
context:
space:
mode:
authorserg@serg.mysql.com <>2001-05-24 13:14:25 +0200
committerserg@serg.mysql.com <>2001-05-24 13:14:25 +0200
commitc3039e80053caaa3a0c08ee5d0eb8eb0b79ab0bc (patch)
tree10377fbee77e1cf260ad739e99d78ff27c26e8d4 /myisam/mi_extra.c
parentf2dee22a7f8c4312215278f46d149c2c0ba68796 (diff)
downloadmariadb-git-c3039e80053caaa3a0c08ee5d0eb8eb0b79ab0bc.tar.gz
ALTER TABLE ... DISABLE/ENABLE KEYS, code cleanup
Diffstat (limited to 'myisam/mi_extra.c')
-rw-r--r--myisam/mi_extra.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/myisam/mi_extra.c b/myisam/mi_extra.c
index cf075512ac4..e1e4fe75a07 100644
--- a/myisam/mi_extra.c
+++ b/myisam/mi_extra.c
@@ -219,9 +219,17 @@ int mi_extra(MI_INFO *info, enum ha_extra_function function)
}
if (share->state.key_map)
{
- share->state.key_map=0;
- info->state->key_file_length=share->state.state.key_file_length=
- share->base.keystart;
+ MI_KEYDEF *key=share->keyinfo;
+ uint i;
+ for (i=0 ; i < share->base.keys ; i++,key++)
+ {
+ if (!(key->flag & HA_NOSAME) && info->s->base.auto_key != i+1)
+ {
+ share->state.key_map&= ~ ((ulonglong) 1 << i);
+ info->update|= HA_STATE_CHANGED;
+ }
+ }
+
if (!share->changed)
{
share->state.changed|= STATE_CHANGED | STATE_NOT_ANALYZED;