summaryrefslogtreecommitdiff
path: root/myisam/mi_check.c
diff options
context:
space:
mode:
Diffstat (limited to 'myisam/mi_check.c')
-rw-r--r--myisam/mi_check.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/myisam/mi_check.c b/myisam/mi_check.c
index 6caacd95386..4b28a88fc6e 100644
--- a/myisam/mi_check.c
+++ b/myisam/mi_check.c
@@ -3562,11 +3562,12 @@ int update_state_info(MI_CHECK *param, MI_INFO *info,uint update)
uint i, key_parts= mi_uint2korr(share->state.header.key_parts);
share->state.rec_per_key_rows=info->state->records;
share->state.changed&= ~STATE_NOT_ANALYZED;
- for (i=0; i<key_parts; i++)
- {
- if (!(share->state.rec_per_key_part[i]=param->rec_per_key_part[i]))
- share->state.changed|= STATE_NOT_ANALYZED;
- }
+ if (info->state->records)
+ for (i=0; i<key_parts; i++)
+ {
+ if (!(share->state.rec_per_key_part[i]=param->rec_per_key_part[i]))
+ share->state.changed|= STATE_NOT_ANALYZED;
+ }
}
if (update & (UPDATE_STAT | UPDATE_SORT | UPDATE_TIME | UPDATE_AUTO_INC))
{