diff options
Diffstat (limited to 'myisam/myisamdef.h')
-rw-r--r-- | myisam/myisamdef.h | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h index 7617d0e7c1d..7f8b6dc41fd 100644 --- a/myisam/myisamdef.h +++ b/myisam/myisamdef.h @@ -222,12 +222,11 @@ struct st_myisam_info { MI_BLOB *blobs; /* Pointer to blobs */ MI_BIT_BUFF bit_buff; /* accumulate indexfile changes between write's */ - TREE *bulk_insert; + TREE *bulk_insert; char *filename; /* parameter to open filename */ uchar *buff, /* Temp area for key */ *lastkey,*lastkey2; /* Last used search key */ - byte *rec_buff, /* Tempbuff for recordpack */ - *rec_alloc; /* Malloced area for record */ + byte *rec_buff; /* Tempbuff for recordpack */ uchar *int_keypos, /* Save position for next/previous */ *int_maxpos; /* -""- */ int (*read_record)(struct st_myisam_info*, my_off_t, byte*); @@ -248,8 +247,7 @@ 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; /* -""- */ + uint int_nod_flag; /* -""- */ int lastinx; /* Last used index */ uint lastkey_length; /* Length of key in lastkey */ uint last_rkey_length; /* Last length in mi_rkey() */ @@ -349,6 +347,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+sizeof(uint)) #define MEMMAP_EXTRA_MARGIN 7 /* Write this as a suffix for file */ @@ -359,8 +358,10 @@ struct st_myisam_info { #define MI_MAX_KEY_BLOCK_SIZE (MI_MAX_KEY_BLOCK_LENGTH/MI_MIN_KEY_BLOCK_LENGTH) #define MI_BLOCK_SIZE(key_length,data_pointer,key_pointer) ((((key_length+data_pointer+key_pointer)*4+key_pointer+2)/myisam_block_size+1)*myisam_block_size) -#define MI_MAX_KEYPTR_SIZE 5 /* For calculating block lengths */ -#define MI_MIN_KEYBLOCK_LENGTH 50 /* When to split delete blocks */ +#define MI_MAX_KEYPTR_SIZE 5 /* For calculating block lengths */ +#define MI_MIN_KEYBLOCK_LENGTH 50 /* When to split delete blocks */ + +#define MI_MIN_SIZE_BULK_INSERT_TREE 16384 /* this is per key */ /* The UNIQUE check is done with a hashed long key */ @@ -508,10 +509,17 @@ 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_fix_rec_buff_for_blob(MI_INFO *info,ulong blob_length); + +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 *from); +extern my_bool _mi_rec_check(MI_INFO *info,const char *record, byte *packpos); extern int _mi_write_part_record(MI_INFO *info,my_off_t filepos,ulong length, my_off_t next_filepos,byte **record, ulong *reclength,int *flag); @@ -637,13 +645,17 @@ int mi_open_datafile(MI_INFO *info, MYISAM_SHARE *share, File file_to_dup); int mi_open_keyfile(MYISAM_SHARE *share); void mi_setup_functions(register MYISAM_SHARE *share); -int _mi_init_bulk_insert(MI_INFO *info); +int _mi_init_bulk_insert(MI_INFO *info, ulong cache_size); /* Functions needed by mi_check */ void mi_check_print_error _VARARGS((MI_CHECK *param, const char *fmt,...)); void mi_check_print_warning _VARARGS((MI_CHECK *param, const char *fmt,...)); void mi_check_print_info _VARARGS((MI_CHECK *param, const char *fmt,...)); -int flush_pending_blocks(MI_CHECK *param); +int flush_pending_blocks(MI_SORT_PARAM *param); +int thr_write_keys(MI_SORT_PARAM *sort_param); +#ifdef THREAD +pthread_handler_decl(thr_find_all_keys,arg); +#endif #ifdef __cplusplus } |