From 6a933b2e08037a4fb17ea98abf00d0990cef22ae Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 2 Mar 2003 01:48:57 +0100 Subject: fix auto-increment in sub-key and insert ... select --- myisam/mi_check.c | 4 ++-- myisam/mi_create.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'myisam') diff --git a/myisam/mi_check.c b/myisam/mi_check.c index 67a7d6f363d..ca5c8f9ecb4 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -3694,8 +3694,8 @@ void mi_disable_non_unique_index(MI_INFO *info, ha_rows rows) MI_KEYDEF *key=share->keyinfo; for (i=0 ; i < share->base.keys ; i++,key++) { - if (!(key->flag & HA_NOSAME) && ! mi_too_big_key_for_sort(key,rows) && - info->s->base.auto_key != i+1) + if (!(key->flag & (HA_NOSAME|HA_AUTO_KEY)) && + ! mi_too_big_key_for_sort(key,rows)) { share->state.key_map&= ~ ((ulonglong) 1 << i); info->update|= HA_STATE_CHANGED; diff --git a/myisam/mi_create.c b/myisam/mi_create.c index 039066c5b37..9082c2b0d95 100644 --- a/myisam/mi_create.c +++ b/myisam/mi_create.c @@ -304,7 +304,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, if (keydef->flag & HA_BINARY_PACK_KEY) options|=HA_OPTION_PACK_KEYS; /* Using packed keys */ - if (keydef->flag & HA_AUTO_KEY) + if (keydef->flag & HA_AUTO_KEY && ci->with_auto_increment) share.base.auto_key=i+1; for (j=0, keyseg=keydef->seg ; j < keydef->keysegs ; j++, keyseg++) { -- cgit v1.2.1