diff options
author | unknown <serg@sergbook.mysql.com> | 2002-07-25 12:30:41 +0200 |
---|---|---|
committer | unknown <serg@sergbook.mysql.com> | 2002-07-25 12:30:41 +0200 |
commit | 31f12b30ee569d26a39daf1d7881f8fc07a9e41b (patch) | |
tree | 710ec910bbec23f6c109cf877fa1f6ce7f4e80fd /myisam/mi_create.c | |
parent | 2154f43e4d311fe6c19083a2b1499ed348da708d (diff) | |
download | mariadb-git-31f12b30ee569d26a39daf1d7881f8fc07a9e41b.tar.gz |
bugfix: uniques did not contributed to MYI tot_length estimation, which resulted in "Index file full" error on huge SELECT DISTINCT's
Diffstat (limited to 'myisam/mi_create.c')
-rw-r--r-- | myisam/mi_create.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/myisam/mi_create.c b/myisam/mi_create.c index 7abf274d621..6941db158e1 100644 --- a/myisam/mi_create.c +++ b/myisam/mi_create.c @@ -392,6 +392,9 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, uniquedef->key=keys+i; unique_key_parts+=uniquedef->keysegs; share.state.key_root[keys+i]= HA_OFFSET_ERROR; + tot_length+= (max_rows/(ulong) (((uint) myisam_block_size-5)/ + ((MI_UNIQUE_HASH_LENGTH + pointer)*2)))* + (ulong) myisam_block_size; } keys+=uniques; /* Each unique has 1 key */ key_segs+=uniques; /* Each unique has 1 key seg */ |