diff options
author | unknown <serg@sergbook.mysql.com> | 2002-07-26 14:42:51 +0200 |
---|---|---|
committer | unknown <serg@sergbook.mysql.com> | 2002-07-26 14:42:51 +0200 |
commit | b0f2b107f912a898aed4a0ce82add12f6df801a3 (patch) | |
tree | 0ec06db644f83dcda914d46e0e1ecad40ea13ab4 /myisam/myisamdef.h | |
parent | 520e95898e360cf2495c664dcfd3ad7aed893551 (diff) | |
download | mariadb-git-b0f2b107f912a898aed4a0ce82add12f6df801a3.tar.gz |
MyISAM: always store alloced_rec_buff_length with the buffer itself
include/myisam.h:
always store alloced_rec_buff_length with the buffer itself
myisam/mi_check.c:
always store alloced_rec_buff_length with the buffer itself
myisam/mi_dynrec.c:
always store alloced_rec_buff_length with the buffer itself
myisam/mi_extra.c:
always store alloced_rec_buff_length with the buffer itself
myisam/mi_key.c:
always store alloced_rec_buff_length with the buffer itself
myisam/mi_open.c:
always store alloced_rec_buff_length with the buffer itself
myisam/mi_packrec.c:
always store alloced_rec_buff_length with the buffer itself
myisam/myisamdef.h:
always store alloced_rec_buff_length with the buffer itself
Diffstat (limited to 'myisam/myisamdef.h')
-rw-r--r-- | myisam/myisamdef.h | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h index 73b9a1280a4..f0d6f740661 100644 --- a/myisam/myisamdef.h +++ b/myisam/myisamdef.h @@ -247,7 +247,6 @@ struct st_myisam_info { int dfile; /* The datafile */ uint opt_flag; /* Optim. for space/speed */ uint update; /* If file changed since open */ - uint alloced_rec_buff_length; /* Max recordlength malloced */ uint int_nod_flag; /* -""- */ int lastinx; /* Last used index */ uint lastkey_length; /* Length of key in lastkey */ @@ -359,7 +358,7 @@ struct st_myisam_info { #define MI_DYN_ALIGN_SIZE 4 /* Align blocks on this */ #define MI_MAX_DYN_HEADER_BYTE 13 /* max header byte for dynamic rows */ #define MI_MAX_BLOCK_LENGTH ((((ulong) 1 << 24)-1) & (~ (ulong) (MI_DYN_ALIGN_SIZE-1))) -#define MI_REC_BUFF_OFFSET ALIGN_SIZE(MI_DYN_DELETE_BLOCK_HEADER) +#define MI_REC_BUFF_OFFSET ALIGN_SIZE(MI_DYN_DELETE_BLOCK_HEADER+sizeof(uint)) #define MEMMAP_EXTRA_MARGIN 7 /* Write this as a suffix for file */ @@ -523,8 +522,14 @@ extern int _mi_read_key_record(MI_INFO *info,my_off_t filepos,byte *buf); extern int _mi_read_cache(IO_CACHE *info,byte *buff,my_off_t pos, uint length,int re_read_if_possibly); extern void update_auto_increment(MI_INFO *info,const byte *record); -extern byte *mi_alloc_rec_buff(MI_INFO *,ulong, byte**, uint*); -extern gptr mi_get_rec_buff_ptr(MI_INFO *, byte *); + +extern byte *mi_alloc_rec_buff(MI_INFO *,ulong, byte**); +#define mi_get_rec_buff_ptr(info,buf) \ + ((((info)->s->options & HA_OPTION_PACK_RECORD) && (buf)) ? \ + (buf) - MI_REC_BUFF_OFFSET : (buf)) +#define mi_get_rec_buff_len(info,buf) \ + (*((uint *)(mi_get_rec_buff_ptr(info,buf)))) + extern ulong _mi_rec_unpack(MI_INFO *info,byte *to,byte *from, ulong reclength); extern my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *packpos); |