summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authorunknown <svoj@mysql.com/april.(none)>2007-04-27 00:56:50 +0500
committerunknown <svoj@mysql.com/april.(none)>2007-04-27 00:56:50 +0500
commit38cbcf7c3681393b45fc6a9233988901363743eb (patch)
treee464af26f683a2f0bc5bdcfdfb73a659e458b695 /myisam
parent11a36eb5ecbb495c32a26be6e075e617bdfb5c27 (diff)
parentfe4551c812a82349a31266b317bbee381a36572b (diff)
downloadmariadb-git-38cbcf7c3681393b45fc6a9233988901363743eb.tar.gz
Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-5.0-build
into mysql.com:/home/svoj/devel/mysql/merge/mysql-5.0-engines
Diffstat (limited to 'myisam')
-rw-r--r--myisam/mi_info.c6
-rw-r--r--myisam/mi_rkey.c4
-rw-r--r--myisam/myisamdef.h1
3 files changed, 7 insertions, 4 deletions
diff --git a/myisam/mi_info.c b/myisam/mi_info.c
index 0435269ed6d..b7de8e7b37d 100644
--- a/myisam/mi_info.c
+++ b/myisam/mi_info.c
@@ -57,9 +57,9 @@ int mi_status(MI_INFO *info, register MI_ISAMINFO *x, uint flag)
x->keys = share->state.header.keys;
x->check_time = share->state.check_time;
- x->mean_reclength = info->state->records ?
- (ulong) ((info->state->data_file_length-info->state->empty)/
- info->state->records) : (ulong) share->min_pack_length;
+ x->mean_reclength= x->records ?
+ (ulong) ((x->data_file_length - x->delete_length) / x->records) :
+ (ulong) share->min_pack_length;
}
if (flag & HA_STATUS_ERRKEY)
{
diff --git a/myisam/mi_rkey.c b/myisam/mi_rkey.c
index 6323c95ffd7..83259a275b1 100644
--- a/myisam/mi_rkey.c
+++ b/myisam/mi_rkey.c
@@ -49,7 +49,7 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len,
key_buff=info->lastkey+info->s->base.max_key_length;
pack_key_length= key_len;
bmove(key_buff,key,key_len);
- last_used_keyseg= 0;
+ last_used_keyseg= info->s->keyinfo[inx].seg + info->last_used_keyseg;
}
else
{
@@ -61,6 +61,8 @@ int mi_rkey(MI_INFO *info, byte *buf, int inx, const byte *key, uint key_len,
key_len, &last_used_keyseg);
/* Save packed_key_length for use by the MERGE engine. */
info->pack_key_length= pack_key_length;
+ info->last_used_keyseg= (uint16) (last_used_keyseg -
+ info->s->keyinfo[inx].seg);
DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE, keyinfo->seg,
key_buff, pack_key_length););
}
diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h
index 0733073a7ea..1a04cbe74fc 100644
--- a/myisam/myisamdef.h
+++ b/myisam/myisamdef.h
@@ -263,6 +263,7 @@ struct st_myisam_info {
enum ha_rkey_function last_key_func; /* CONTAIN, OVERLAP, etc */
uint save_lastkey_length;
uint pack_key_length; /* For MYISAMMRG */
+ uint16 last_used_keyseg; /* For MyISAMMRG */
int errkey; /* Got last error on this key */
int lock_type; /* How database was locked */
int tmp_lock_type; /* When locked by readinfo */