diff options
38 files changed, 106 insertions, 105 deletions
diff --git a/BitKeeper/etc/logging_ok b/BitKeeper/etc/logging_ok index 20daaf3a8d6..a0fb630c348 100644 --- a/BitKeeper/etc/logging_ok +++ b/BitKeeper/etc/logging_ok @@ -53,3 +53,4 @@ tonu@x3.internalnet venu@work.mysql.com zak@balfor.local zak@linux.local +ram@gw.udmsearch.izhnet.ru diff --git a/heap/heapdef.h b/heap/heapdef.h index 53ad87a7d20..aeb345522f5 100644 --- a/heap/heapdef.h +++ b/heap/heapdef.h @@ -42,7 +42,7 @@ typedef struct st_hp_hash_info } HASH_INFO; typedef struct { - MI_KEYSEG *keyseg; + HA_KEYSEG *keyseg; uint key_length; uint search_flag; } heap_rb_param; diff --git a/heap/hp_hash.c b/heap/hp_hash.c index b13ce786f6d..92e6320211a 100644 --- a/heap/hp_hash.c +++ b/heap/hp_hash.c @@ -195,7 +195,7 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key) { /*register*/ ulong nr=1, nr2=4; - MI_KEYSEG *seg,*endseg; + HA_KEYSEG *seg,*endseg; for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++) { @@ -242,7 +242,7 @@ ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec) { /*register*/ ulong nr=1, nr2=4; - MI_KEYSEG *seg,*endseg; + HA_KEYSEG *seg,*endseg; for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++) { @@ -300,7 +300,7 @@ ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec) ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key) { register ulong nr=0; - MI_KEYSEG *seg,*endseg; + HA_KEYSEG *seg,*endseg; for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++) { @@ -341,7 +341,7 @@ ulong hp_hashnr(register HP_KEYDEF *keydef, register const byte *key) ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec) { register ulong nr=0; - MI_KEYSEG *seg,*endseg; + HA_KEYSEG *seg,*endseg; for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++) { @@ -381,7 +381,7 @@ ulong hp_rec_hashnr(register HP_KEYDEF *keydef, register const byte *rec) int hp_rec_key_cmp(HP_KEYDEF *keydef, const byte *rec1, const byte *rec2) { - MI_KEYSEG *seg,*endseg; + HA_KEYSEG *seg,*endseg; for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++) { @@ -412,7 +412,7 @@ int hp_rec_key_cmp(HP_KEYDEF *keydef, const byte *rec1, const byte *rec2) int hp_key_cmp(HP_KEYDEF *keydef, const byte *rec, const byte *key) { - MI_KEYSEG *seg,*endseg; + HA_KEYSEG *seg,*endseg; for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; @@ -450,7 +450,7 @@ int hp_key_cmp(HP_KEYDEF *keydef, const byte *rec, const byte *key) void hp_make_key(HP_KEYDEF *keydef, byte *key, const byte *rec) { - MI_KEYSEG *seg,*endseg; + HA_KEYSEG *seg,*endseg; for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++) { @@ -464,7 +464,7 @@ void hp_make_key(HP_KEYDEF *keydef, byte *key, const byte *rec) void hp_rb_make_key(HP_KEYDEF *keydef, byte *key, const byte *rec, byte *recpos) { - MI_KEYSEG *seg, *endseg; + HA_KEYSEG *seg, *endseg; /* -1 means that HA_KEYTYPE_END segment will not copy */ for (seg= keydef->seg, endseg= seg + keydef->keysegs - 1; seg < endseg; @@ -481,7 +481,7 @@ void hp_rb_make_key(HP_KEYDEF *keydef, byte *key, uint hp_rb_pack_key(HP_INFO *info, uint inx, uchar *key, const uchar *old, uint k_length) { - MI_KEYSEG *seg, *endseg; + HA_KEYSEG *seg, *endseg; uchar *start_key= key; HP_KEYDEF *keydef= info->s->keydef + inx; @@ -508,7 +508,7 @@ uint hp_rb_pack_key(HP_INFO *info, uint inx, uchar *key, const uchar *old, my_bool hp_if_null_in_key(HP_KEYDEF *keydef, const byte *record) { - MI_KEYSEG *seg,*endseg; + HA_KEYSEG *seg,*endseg; for (seg=keydef->seg,endseg=seg+keydef->keysegs ; seg < endseg ; seg++) { if (seg->null_bit && (record[seg->null_pos] & seg->null_bit)) diff --git a/heap/hp_open.c b/heap/hp_open.c index a2423d5a4ff..49f9a2cfc33 100644 --- a/heap/hp_open.c +++ b/heap/hp_open.c @@ -41,7 +41,7 @@ HP_INFO *heap_open(const char *name, int mode, uint keys, HP_KEYDEF *keydef, uint i,j,key_segs,max_length,length; HP_INFO *info; HP_SHARE *share; - MI_KEYSEG *keyseg; + HA_KEYSEG *keyseg; DBUG_ENTER("heap_open"); @@ -72,14 +72,14 @@ HP_INFO *heap_open(const char *name, int mode, uint keys, HP_KEYDEF *keydef, } if (!(share = (HP_SHARE*) my_malloc((uint) sizeof(HP_SHARE)+ keys*sizeof(HP_KEYDEF)+ - key_segs*sizeof(MI_KEYSEG), + key_segs*sizeof(HA_KEYSEG), MYF(MY_ZEROFILL)))) { pthread_mutex_unlock(&THR_LOCK_heap); DBUG_RETURN(0); } share->keydef=(HP_KEYDEF*) (share+1); - keyseg=(MI_KEYSEG*) (share->keydef+keys); + keyseg=(HA_KEYSEG*) (share->keydef+keys); init_block(&share->block,reclength+1,min_records,max_records); /* Fix keys */ memcpy(share->keydef,keydef,(size_t) (sizeof(keydef[0])*keys)); diff --git a/heap/hp_test1.c b/heap/hp_test1.c index 124a2901402..79edfe2effc 100644 --- a/heap/hp_test1.c +++ b/heap/hp_test1.c @@ -36,7 +36,7 @@ int main(int argc, char **argv) char record[128],key[32]; const char *filename; HP_KEYDEF keyinfo[10]; - MI_KEYSEG keyseg[4]; + HA_KEYSEG keyseg[4]; MY_INIT(argv[0]); filename= "test1"; diff --git a/heap/hp_test2.c b/heap/hp_test2.c index 5d945dca282..f8b6a8cd7d3 100644 --- a/heap/hp_test2.c +++ b/heap/hp_test2.c @@ -61,7 +61,7 @@ int main(int argc, char *argv[]) const char *filename,*filename2; HP_INFO *file,*file2; HP_KEYDEF keyinfo[MAX_KEYS]; - MI_KEYSEG keyseg[MAX_KEYS*5]; + HA_KEYSEG keyseg[MAX_KEYS*5]; HEAP_PTR position; MY_INIT(argv[0]); /* init my_sys library & pthreads */ LINT_INIT(position); diff --git a/include/heap.h b/include/heap.h index ebcad285f55..088bb1241b2 100644 --- a/include/heap.h +++ b/include/heap.h @@ -85,7 +85,7 @@ typedef struct st_hp_keydef /* Key definition with open */ uint length; /* Length of key (automatic) */ uint8 algorithm; /* HASH / BTREE */ uint ref_offs; /* Data reference offset */ - MI_KEYSEG *seg; + HA_KEYSEG *seg; HP_BLOCK block; /* Where keys are saved */ TREE rb_tree; int (*write_key)(struct st_heap_info *info, struct st_hp_keydef *keyinfo, diff --git a/include/my_handler.h b/include/my_handler.h index ddbb33cd93f..0fa30f580b6 100644 --- a/include/my_handler.h +++ b/include/my_handler.h @@ -23,7 +23,7 @@ #include "m_ctype.h" #include "myisampack.h" -typedef struct st_MI_KEYSEG /* Key-portion */ +typedef struct st_HA_KEYSEG /* Key-portion */ { uint8 type; /* Type of key (for sort) */ uint8 language; @@ -34,7 +34,7 @@ typedef struct st_MI_KEYSEG /* Key-portion */ uint32 start; /* Start of key in record */ uint32 null_pos; /* position to NULL indicator */ CHARSET_INFO *charset; -} MI_KEYSEG; +} HA_KEYSEG; #define get_key_length(length,key) \ { if ((uchar) *(key) != 255) \ @@ -52,11 +52,11 @@ typedef struct st_MI_KEYSEG /* Key-portion */ extern int _mi_compare_text(CHARSET_INFO *, uchar *, uint, uchar *, uint , my_bool); -extern int _mi_key_cmp(register MI_KEYSEG *keyseg, register uchar *a, +extern int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a, register uchar *b, uint key_length, uint nextflag, uint *diff_pos); -extern int hp_rb_key_cmp(register MI_KEYSEG *keyseg, register uchar *a, +extern int hp_rb_key_cmp(register HA_KEYSEG *keyseg, register uchar *a, register uchar *b, uint key_length, uint nextflag, uint *diff_pos); diff --git a/include/myisam.h b/include/myisam.h index bf714dfef8a..96cbeaf0cd4 100644 --- a/include/myisam.h +++ b/include/myisam.h @@ -122,7 +122,7 @@ typedef struct st_mi_keydef /* Key definition with open & info */ uint16 block_size; /* block_size (auto) */ uint32 version; /* For concurrent read/write */ - MI_KEYSEG *seg,*end; + HA_KEYSEG *seg,*end; int (*bin_search)(struct st_myisam_info *info,struct st_mi_keydef *keyinfo, uchar *page,uchar *key, uint key_len,uint comp_flag,uchar * *ret_pos, @@ -146,7 +146,7 @@ typedef struct st_unique_def /* Segment definition of unique */ uint16 keysegs; /* Number of key-segment */ uchar key; /* Mapped to which key */ uint8 null_are_equal; - MI_KEYSEG *seg,*end; + HA_KEYSEG *seg,*end; } MI_UNIQUEDEF; typedef struct st_mi_decode_tree /* Decode huff-table */ @@ -318,7 +318,7 @@ typedef struct st_sort_info { char *record,*buff; void *wordlist, *wordptr; MI_KEYDEF *keyinfo; - MI_KEYSEG *keyseg; + HA_KEYSEG *keyseg; } SORT_INFO; typedef struct st_mi_check_param diff --git a/myisam/ft_eval.h b/myisam/ft_eval.h index 68be3a39f33..5501fe9d34b 100644 --- a/myisam/ft_eval.h +++ b/myisam/ft_eval.h @@ -33,7 +33,7 @@ FILE *df,*qf; MI_COLUMNDEF recinfo[3]; MI_KEYDEF keyinfo[2]; -MI_KEYSEG keyseg[10]; +HA_KEYSEG keyseg[10]; #define SWL_INIT 500 #define SWL_PLUS 50 diff --git a/myisam/ft_static.c b/myisam/ft_static.c index 3efb3a3ec74..640b754afa9 100644 --- a/myisam/ft_static.c +++ b/myisam/ft_static.c @@ -23,7 +23,7 @@ ulong ft_max_word_len=HA_FT_MAXLEN; ulong ft_max_word_len_for_sort=20; const char *ft_boolean_syntax="+ -><()~*:\"\"&|"; -const MI_KEYSEG ft_keysegs[FT_SEGS]={ +const HA_KEYSEG ft_keysegs[FT_SEGS]={ { HA_KEYTYPE_VARTEXT, /* type */ 7, /* language (will be overwritten) */ diff --git a/myisam/ft_test1.c b/myisam/ft_test1.c index e1a47ff87c3..caa41d4a8c5 100644 --- a/myisam/ft_test1.c +++ b/myisam/ft_test1.c @@ -45,7 +45,7 @@ int main(int argc,char *argv[]) static MI_COLUMNDEF recinfo[3]; static MI_KEYDEF keyinfo[2]; -static MI_KEYSEG keyseg[10]; +static HA_KEYSEG keyseg[10]; static int run_test(const char *filename) { diff --git a/myisam/ftdefs.h b/myisam/ftdefs.h index 1a3c0ef60dc..f829a5f0c3a 100644 --- a/myisam/ftdefs.h +++ b/myisam/ftdefs.h @@ -122,7 +122,7 @@ byte ft_simple_get_word(byte **, byte *, FT_WORD *); typedef struct _st_ft_seg_iterator { uint num, len; - MI_KEYSEG *seg; + HA_KEYSEG *seg; const byte *rec, *pos; } FT_SEG_ITERATOR; diff --git a/myisam/fulltext.h b/myisam/fulltext.h index f787c9bcfe8..39801c1c87e 100644 --- a/myisam/fulltext.h +++ b/myisam/fulltext.h @@ -32,7 +32,7 @@ #define FT_SEGS 2 #endif /* EVAL_RUN */ -extern const MI_KEYSEG ft_keysegs[FT_SEGS]; +extern const HA_KEYSEG ft_keysegs[FT_SEGS]; int _mi_ft_cmp(MI_INFO *, uint, const byte *, const byte *); int _mi_ft_add(MI_INFO *, uint, byte *, const byte *, my_off_t); diff --git a/myisam/mi_check.c b/myisam/mi_check.c index 2ba74836ab7..9dceccc164f 100644 --- a/myisam/mi_check.c +++ b/myisam/mi_check.c @@ -588,7 +588,7 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, goto err; } if ((*keys)++ && - (flag=_mi_key_cmp(keyinfo->seg,info->lastkey,key,key_length, + (flag=ha_key_cmp(keyinfo->seg,info->lastkey,key,key_length, comp_flag, ¬_used)) >=0) { DBUG_DUMP("old",(byte*) info->lastkey, info->lastkey_length); @@ -606,7 +606,7 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo, if (*keys != 1L) /* not first_key */ { uint diff; - _mi_key_cmp(keyinfo->seg,info->lastkey,key,USE_WHOLE_KEY,SEARCH_FIND, + ha_key_cmp(keyinfo->seg,info->lastkey,key,USE_WHOLE_KEY,SEARCH_FIND, &diff); param->unique_count[diff-1]++; } @@ -674,7 +674,7 @@ static ha_checksum calc_checksum(ha_rows count) static uint isam_key_length(MI_INFO *info, register MI_KEYDEF *keyinfo) { uint length; - MI_KEYSEG *keyseg; + HA_KEYSEG *keyseg; DBUG_ENTER("isam_key_length"); length= info->s->rec_reflength; @@ -2625,7 +2625,7 @@ int sort_write_record(SORT_INFO *sort_info) static int sort_key_cmp(SORT_INFO *sort_info, const void *a, const void *b) { uint not_used; - return (_mi_key_cmp(sort_info->keyseg,*((uchar**) a),*((uchar**) b), + return (ha_key_cmp(sort_info->keyseg,*((uchar**) a),*((uchar**) b), USE_WHOLE_KEY, SEARCH_SAME,¬_used)); } /* sort_key_cmp */ @@ -2639,7 +2639,7 @@ static int sort_key_write(SORT_INFO *sort_info, const void *a) if (sort_info->key_block->inited) { - cmp=_mi_key_cmp(sort_info->keyseg,sort_info->key_block->lastkey,(uchar*) a, + cmp=ha_key_cmp(sort_info->keyseg,sort_info->key_block->lastkey,(uchar*) a, USE_WHOLE_KEY,SEARCH_FIND | SEARCH_UPDATE ,&diff_pos); sort_info->unique[diff_pos-1]++; } @@ -2922,7 +2922,7 @@ int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename) MI_INFO info; MYISAM_SHARE share; MI_KEYDEF *keyinfo,*key,*key_end; - MI_KEYSEG *keysegs,*keyseg; + HA_KEYSEG *keysegs,*keyseg; MI_COLUMNDEF *recdef,*rec,*end; MI_UNIQUEDEF *uniquedef,*u_ptr,*u_end; MI_STATUS_INFO status_info; @@ -2944,7 +2944,7 @@ int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename) (size_t) (sizeof(MI_KEYDEF)*share.base.keys)); key_parts= share.base.all_key_parts; - if (!(keysegs=(MI_KEYSEG*) my_alloca(sizeof(MI_KEYSEG)* + if (!(keysegs=(HA_KEYSEG*) my_alloca(sizeof(HA_KEYSEG)* (key_parts+share.base.keys)))) { my_afree((gptr) keyinfo); @@ -2980,7 +2980,7 @@ int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename) /* Change the new key to point at the saved key segments */ memcpy((byte*) keysegs,(byte*) share.keyparts, - (size_t) (sizeof(MI_KEYSEG)*(key_parts+share.base.keys+ + (size_t) (sizeof(HA_KEYSEG)*(key_parts+share.base.keys+ share.state.header.uniques))); keyseg=keysegs; for (key=keyinfo,key_end=keyinfo+share.base.keys; key != key_end ; key++) diff --git a/myisam/mi_create.c b/myisam/mi_create.c index 8f4a44a52a4..13d9443c099 100644 --- a/myisam/mi_create.c +++ b/myisam/mi_create.c @@ -53,7 +53,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, MYISAM_SHARE share; MI_KEYDEF *keydef,tmp_keydef; MI_UNIQUEDEF *uniquedef; - MI_KEYSEG *keyseg,tmp_keyseg; + HA_KEYSEG *keyseg,tmp_keyseg; MI_COLUMNDEF *rec; ulong *rec_per_key_part; my_off_t key_root[MI_MAX_POSSIBLE_KEY],key_del[MI_MAX_KEY_BLOCK_SIZE]; @@ -440,7 +440,7 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, info_length=base_pos+(uint) (MI_BASE_INFO_SIZE+ keys * MI_KEYDEF_SIZE+ uniques * MI_UNIQUEDEF_SIZE + - (key_segs + unique_key_parts)*MI_KEYSEG_SIZE+ + (key_segs + unique_key_parts)*HA_KEYSEG_SIZE+ columns*MI_COLUMNDEF_SIZE); bmove(share.state.header.file_version,(byte*) myisam_file_magic,4); @@ -596,14 +596,14 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs, goto err; for (j=0 ; j < ft_segs ; j++) { - MI_KEYSEG seg=ft_keysegs[j]; + HA_KEYSEG seg=ft_keysegs[j]; seg.language= keydefs[i].seg[0].language; if (mi_keyseg_write(file, &seg)) goto err; } for (j=0 ; j < sp_segs ; j++) { - MI_KEYSEG sseg; + HA_KEYSEG sseg; sseg.type=SPTYPE; sseg.language= 7; sseg.null_bit=0; diff --git a/myisam/mi_dbug.c b/myisam/mi_dbug.c index 482287938c0..6548b38c135 100644 --- a/myisam/mi_dbug.c +++ b/myisam/mi_dbug.c @@ -20,7 +20,7 @@ /* Print a key in user understandable format */ -void _mi_print_key(FILE *stream, register MI_KEYSEG *keyseg, +void _mi_print_key(FILE *stream, register HA_KEYSEG *keyseg, const uchar *key, uint length) { int flag; diff --git a/myisam/mi_key.c b/myisam/mi_key.c index 055b18284de..067556a3222 100644 --- a/myisam/mi_key.c +++ b/myisam/mi_key.c @@ -37,7 +37,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, { byte *pos,*end; uchar *start; - reg1 MI_KEYSEG *keyseg; + reg1 HA_KEYSEG *keyseg; DBUG_ENTER("_mi_make_key"); if(info->s->keyinfo[keynr].flag & HA_SPATIAL) @@ -153,7 +153,7 @@ uint _mi_pack_key(register MI_INFO *info, uint keynr, uchar *key, uchar *old, { uint length; uchar *pos,*end,*start_key=key; - reg1 MI_KEYSEG *keyseg; + reg1 HA_KEYSEG *keyseg; enum ha_base_keytype type; DBUG_ENTER("_mi_pack_key"); @@ -252,7 +252,7 @@ static int _mi_put_key_in_record(register MI_INFO *info, uint keynr, { reg2 byte *key; byte *pos,*key_end; - reg1 MI_KEYSEG *keyseg; + reg1 HA_KEYSEG *keyseg; byte *blob_ptr; DBUG_ENTER("_mi_put_key_in_record"); @@ -385,7 +385,7 @@ int _mi_read_key_record(MI_INFO *info, my_off_t filepos, byte *buf) void update_auto_increment(MI_INFO *info,const byte *record) { ulonglong value; - MI_KEYSEG *keyseg=info->s->keyinfo[info->s->base.auto_key-1].seg; + HA_KEYSEG *keyseg=info->s->keyinfo[info->s->base.auto_key-1].seg; const uchar *key=(uchar*) record+keyseg->start; switch (keyseg->type) { diff --git a/myisam/mi_open.c b/myisam/mi_open.c index 3dc6c9bf61f..d2960c6751c 100644 --- a/myisam/mi_open.c +++ b/myisam/mi_open.c @@ -256,7 +256,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) &share->uniqueinfo,uniques*sizeof(MI_UNIQUEDEF), &share->keyparts, (key_parts+unique_key_parts+keys+uniques) * - sizeof(MI_KEYSEG), + sizeof(HA_KEYSEG), &share->rec, (share->base.fields+1)*sizeof(MI_COLUMNDEF), &share->blobs,sizeof(MI_BLOB)*share->base.blobs, @@ -286,7 +286,7 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) share->blocksize=min(IO_SIZE,myisam_block_size); { - MI_KEYSEG *pos=share->keyparts; + HA_KEYSEG *pos=share->keyparts; for (i=0 ; i < keys ; i++) { disk_pos=mi_keydef_read(disk_pos, &share->keyinfo[i]); @@ -949,9 +949,9 @@ char *mi_keydef_read(char *ptr, MI_KEYDEF *keydef) ** mi_keyseg ***************************************************************************/ -int mi_keyseg_write(File file, const MI_KEYSEG *keyseg) +int mi_keyseg_write(File file, const HA_KEYSEG *keyseg) { - uchar buff[MI_KEYSEG_SIZE]; + uchar buff[HA_KEYSEG_SIZE]; uchar *ptr=buff; *ptr++ =keyseg->type; @@ -969,7 +969,7 @@ int mi_keyseg_write(File file, const MI_KEYSEG *keyseg) } -char *mi_keyseg_read(char *ptr, MI_KEYSEG *keyseg) +char *mi_keyseg_read(char *ptr, HA_KEYSEG *keyseg) { keyseg->type = *ptr++; keyseg->language = *ptr++; diff --git a/myisam/mi_rnext_same.c b/myisam/mi_rnext_same.c index 88ff24842d4..88146c89f85 100644 --- a/myisam/mi_rnext_same.c +++ b/myisam/mi_rnext_same.c @@ -60,7 +60,7 @@ int mi_rnext_same(MI_INFO *info, byte *buf) info->lastkey_length,flag, info->s->state.key_root[inx]))) break; - if (_mi_key_cmp(keyinfo->seg,info->lastkey2,info->lastkey, + if (ha_key_cmp(keyinfo->seg,info->lastkey2,info->lastkey, info->last_rkey_length, SEARCH_FIND, ¬_used)) { error=1; diff --git a/myisam/mi_search.c b/myisam/mi_search.c index 09b4159737f..46d1cd19142 100644 --- a/myisam/mi_search.c +++ b/myisam/mi_search.c @@ -133,7 +133,7 @@ int _mi_search(register MI_INFO *info, register MI_KEYDEF *keyinfo, &info->lastkey_length)) goto err; if ((nextflag & SEARCH_LAST) && - _mi_key_cmp(keyinfo->seg, info->lastkey, key, key_len, SEARCH_FIND, + ha_key_cmp(keyinfo->seg, info->lastkey, key, key_len, SEARCH_FIND, ¬_used)) { my_errno=HA_ERR_KEY_NOT_FOUND; /* Didn't find key */ @@ -191,7 +191,7 @@ int _mi_bin_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, while (start != end) { mid= (start+end)/2; - if ((flag=_mi_key_cmp(keyinfo->seg,page+(uint) mid*totlength,key,key_len, + if ((flag=ha_key_cmp(keyinfo->seg,page+(uint) mid*totlength,key,key_len, comp_flag,¬_used)) >= 0) end=mid; @@ -199,7 +199,7 @@ int _mi_bin_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, start=mid+1; } if (mid != start) - flag=_mi_key_cmp(keyinfo->seg,page+(uint) start*totlength,key,key_len, + flag=ha_key_cmp(keyinfo->seg,page+(uint) start*totlength,key,key_len, comp_flag,¬_used); if (flag < 0) start++; /* point at next, bigger key */ @@ -239,7 +239,7 @@ int _mi_seq_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, length,page,end)); DBUG_RETURN(MI_FOUND_WRONG_KEY); } - if ((flag=_mi_key_cmp(keyinfo->seg,t_buff,key,key_len,comp_flag, + if ((flag=ha_key_cmp(keyinfo->seg,t_buff,key,key_len,comp_flag, ¬_used)) >= 0) break; #ifdef EXTRA_DEBUG @@ -262,7 +262,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, { /* my_flag is raw comparison result to be changed according to SEARCH_NO_FIND,SEARCH_LAST and HA_REVERSE_SORT flags. - flag is the value returned by _mi_key_cmp and as treated as final */ + flag is the value returned by ha_key_cmp and as treated as final */ int flag=0, my_flag=-1; uint nod_flag, length, len, matched, cmplen, kseg_len; uint prefix_len,suffix_len; @@ -351,7 +351,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, DBUG_PRINT("loop",("page: '%.*s%.*s'",prefix_len,t_buff+seg_len_pack,suffix_len,vseg)); { uchar *from=vseg+suffix_len; - MI_KEYSEG *keyseg; + HA_KEYSEG *keyseg; uint l; for (keyseg=keyinfo->seg+1 ; keyseg->type ; keyseg++ ) @@ -423,7 +423,7 @@ int _mi_prefix_search(MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *page, else if (key_len_left>0) { uint not_used; - if ((flag = _mi_key_cmp(keyinfo->seg+1,vseg, + if ((flag = ha_key_cmp(keyinfo->seg+1,vseg, k,key_len_left,nextflag,¬_used)) >= 0) break; } @@ -674,7 +674,7 @@ uint _mi_get_static_key(register MI_KEYDEF *keyinfo, uint nod_flag, uint _mi_get_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, register uchar **page_pos, register uchar *key) { - reg1 MI_KEYSEG *keyseg; + reg1 HA_KEYSEG *keyseg; uchar *start_key,*page=*page_pos; uint length; @@ -807,7 +807,7 @@ uint _mi_get_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, uint _mi_get_binary_pack_key(register MI_KEYDEF *keyinfo, uint nod_flag, register uchar **page_pos, register uchar *key) { - reg1 MI_KEYSEG *keyseg; + reg1 HA_KEYSEG *keyseg; uchar *start_key,*page=*page_pos,*page_end,*from,*from_end; uint length,tmp; @@ -1006,7 +1006,7 @@ uchar *_mi_get_last_key(MI_INFO *info, MI_KEYDEF *keyinfo, uchar *page, uint _mi_keylength(MI_KEYDEF *keyinfo, register uchar *key) { - reg1 MI_KEYSEG *keyseg; + reg1 HA_KEYSEG *keyseg; uchar *start; if (! (keyinfo->flag & (HA_VAR_LENGTH_KEY | HA_BINARY_PACK_KEY))) @@ -1272,7 +1272,7 @@ _mi_calc_var_pack_key_length(MI_KEYDEF *keyinfo,uint nod_flag,uchar *next_key, uchar *org_key, uchar *prev_key, uchar *key, MI_KEY_PARAM *s_temp) { - reg1 MI_KEYSEG *keyseg; + reg1 HA_KEYSEG *keyseg; int length; uint key_length,ref_length,org_key_length=0, length_pack,new_key_length,diff_flag,pack_marker; diff --git a/myisam/mi_test1.c b/myisam/mi_test1.c index 412c493db9a..b477263dd4a 100644 --- a/myisam/mi_test1.c +++ b/myisam/mi_test1.c @@ -33,8 +33,8 @@ static uint unique_key=HA_NOSAME,key_cacheing=0,opt_unique=0; static uint silent; static MI_COLUMNDEF recinfo[4]; static MI_KEYDEF keyinfo[10]; -static MI_KEYSEG keyseg[10]; -static MI_KEYSEG uniqueseg[10]; +static HA_KEYSEG keyseg[10]; +static HA_KEYSEG uniqueseg[10]; static int run_test(const char *filename); static void get_options(int argc, char *argv[]); diff --git a/myisam/mi_test2.c b/myisam/mi_test2.c index 54752b43fbd..a4c813b718b 100644 --- a/myisam/mi_test2.c +++ b/myisam/mi_test2.c @@ -55,7 +55,7 @@ static uint use_blob=0; static uint16 key1[1001],key3[5000]; static char record[300],record2[300],key[100],key2[100], read_record[300],read_record2[300],read_record3[300]; -static MI_KEYSEG glob_keyseg[MYISAM_KEYS][MAX_PARTS]; +static HA_KEYSEG glob_keyseg[MYISAM_KEYS][MAX_PARTS]; /* Test program */ @@ -1006,7 +1006,7 @@ static void put_blob_in_record(char *blob_pos, char **blob_buffer) static void copy_key(MI_INFO *info,uint inx,uchar *rec,uchar *key_buff) { - MI_KEYSEG *keyseg; + HA_KEYSEG *keyseg; for (keyseg=info->s->keyinfo[inx].seg ; keyseg->type ; keyseg++) { diff --git a/myisam/mi_test3.c b/myisam/mi_test3.c index 17c4e92d2ba..405345259cb 100644 --- a/myisam/mi_test3.c +++ b/myisam/mi_test3.c @@ -59,7 +59,7 @@ int main(int argc,char **argv) uint i=0; MI_KEYDEF keyinfo[10]; MI_COLUMNDEF recinfo[10]; - MI_KEYSEG keyseg[10][2]; + HA_KEYSEG keyseg[10][2]; MY_INIT(argv[0]); get_options(argc,argv); diff --git a/myisam/mi_unique.c b/myisam/mi_unique.c index 5806502823a..629523ec69a 100644 --- a/myisam/mi_unique.c +++ b/myisam/mi_unique.c @@ -70,7 +70,7 @@ ha_checksum mi_unique_hash(MI_UNIQUEDEF *def, const byte *record) { const byte *pos, *end; ha_checksum crc=0; - MI_KEYSEG *keyseg; + HA_KEYSEG *keyseg; for (keyseg=def->seg ; keyseg < def->end ; keyseg++) { @@ -122,7 +122,7 @@ int mi_unique_comp(MI_UNIQUEDEF *def, const byte *a, const byte *b, my_bool null_are_equal) { const byte *pos_a, *pos_b, *end; - MI_KEYSEG *keyseg; + HA_KEYSEG *keyseg; for (keyseg=def->seg ; keyseg < def->end ; keyseg++) { diff --git a/myisam/mi_write.c b/myisam/mi_write.c index fe7187d59ef..85bcb8427df 100644 --- a/myisam/mi_write.c +++ b/myisam/mi_write.c @@ -764,7 +764,7 @@ int _mi_ck_write_tree(register MI_INFO *info, uint keynr, uchar *key, static int keys_compare(bulk_insert_param *param, uchar *key1, uchar *key2) { uint not_used; - return _mi_key_cmp(param->info->s->keyinfo[param->keynr].seg, + return ha_key_cmp(param->info->s->keyinfo[param->keynr].seg, key1, key2, USE_WHOLE_KEY, SEARCH_SAME, ¬_used); } diff --git a/myisam/myisamchk.c b/myisam/myisamchk.c index 10bd29e25e3..0f290712841 100644 --- a/myisam/myisamchk.c +++ b/myisam/myisamchk.c @@ -1062,7 +1062,7 @@ static void descript(MI_CHECK *param, register MI_INFO *info, my_string name) { uint key,keyseg_nr,field,start; reg3 MI_KEYDEF *keyinfo; - reg2 MI_KEYSEG *keyseg; + reg2 HA_KEYSEG *keyseg; reg4 const char *text; char buff[160],length[10],*pos,*end; enum en_fieldtype type; diff --git a/myisam/myisamdef.h b/myisam/myisamdef.h index 417b6762065..7617d0e7c1d 100644 --- a/myisam/myisamdef.h +++ b/myisam/myisamdef.h @@ -96,7 +96,7 @@ typedef struct st_mi_state_info #define MI_STATE_EXTRA_SIZE ((MI_MAX_KEY+MI_MAX_KEY_BLOCK_SIZE)*MI_STATE_KEY_SIZE + MI_MAX_KEY*MI_MAX_KEY_SEG*MI_STATE_KEYSEG_SIZE) #define MI_KEYDEF_SIZE (2+ 5*2) #define MI_UNIQUEDEF_SIZE (2+1+1) -#define MI_KEYSEG_SIZE (6+ 2*2 + 4*2) +#define HA_KEYSEG_SIZE (6+ 2*2 + 4*2) #define MI_COLUMNDEF_SIZE (2*3+1) #define MI_BASE_INFO_SIZE (5*8 + 8*4 + 4 + 4*2 + 16) #define MI_INDEX_BLOCK_MARGIN 16 /* Safety margin for .MYI tables */ @@ -156,7 +156,7 @@ typedef struct st_mi_isam_share { /* Shared between opens */ MI_BASE_INFO base; MI_KEYDEF *keyinfo; /* Key definitions */ MI_UNIQUEDEF *uniqueinfo; /* unique definitions */ - MI_KEYSEG *keyparts; /* key part info */ + HA_KEYSEG *keyparts; /* key part info */ MI_COLUMNDEF *rec; /* Pointer to field information */ MI_PACK pack; /* Data about packed records */ MI_BLOB *blobs; /* Pointer to blobs */ @@ -355,7 +355,7 @@ struct st_myisam_info { #define PACK_TYPE_SELECTED 1 /* Bits in field->pack_type */ #define PACK_TYPE_SPACE_FIELDS 2 #define PACK_TYPE_ZERO_FILL 4 -#define MI_FOUND_WRONG_KEY 32738 /* Impossible value from _mi_key_cmp */ +#define MI_FOUND_WRONG_KEY 32738 /* Impossible value from ha_key_cmp */ #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) @@ -475,7 +475,7 @@ extern void _mi_kpointer(MI_INFO *info,uchar *buff,my_off_t pos); extern my_off_t _mi_dpos(MI_INFO *info, uint nod_flag,uchar *after_key); extern my_off_t _mi_rec_pos(MYISAM_SHARE *info, uchar *ptr); extern void _mi_dpointer(MI_INFO *info, uchar *buff,my_off_t pos); -extern int _mi_key_cmp(MI_KEYSEG *keyseg, uchar *a,uchar *b, +extern int ha_key_cmp(HA_KEYSEG *keyseg, uchar *a,uchar *b, uint key_length,uint nextflag,uint *diff_length); extern uint _mi_get_static_key(MI_KEYDEF *keyinfo,uint nod_flag,uchar * *page, uchar *key); @@ -515,7 +515,7 @@ extern my_bool _mi_rec_check(MI_INFO *info,const char *from); 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); -extern void _mi_print_key(FILE *stream,MI_KEYSEG *keyseg,const uchar *key, +extern void _mi_print_key(FILE *stream,HA_KEYSEG *keyseg,const uchar *key, uint length); extern my_bool _mi_read_pack_info(MI_INFO *info,pbool fix_keys); extern int _mi_read_pack_record(MI_INFO *info,my_off_t filepos,byte *buf); @@ -606,8 +606,8 @@ char *mi_state_info_read(char *ptr, MI_STATE_INFO *state); uint mi_state_info_read_dsk(File file, MI_STATE_INFO *state, my_bool pRead); uint mi_base_info_write(File file, MI_BASE_INFO *base); char *my_n_base_info_read(char *ptr, MI_BASE_INFO *base); -int mi_keyseg_write(File file, const MI_KEYSEG *keyseg); -char *mi_keyseg_read(char *ptr, MI_KEYSEG *keyseg); +int mi_keyseg_write(File file, const HA_KEYSEG *keyseg); +char *mi_keyseg_read(char *ptr, HA_KEYSEG *keyseg); uint mi_keydef_write(File file, MI_KEYDEF *keydef); char *mi_keydef_read(char *ptr, MI_KEYDEF *keydef); uint mi_uniquedef_write(File file, MI_UNIQUEDEF *keydef); diff --git a/myisam/rt_mbr.c b/myisam/rt_mbr.c index 7ffc1cfa267..a6467500183 100644 --- a/myisam/rt_mbr.c +++ b/myisam/rt_mbr.c @@ -93,7 +93,7 @@ MBR_DATA(a,b) Data reference is the same Returns 0 on success. */ -int rtree_key_cmp(MI_KEYSEG *keyseg, uchar *b, uchar *a, uint key_length, +int rtree_key_cmp(HA_KEYSEG *keyseg, uchar *b, uchar *a, uint key_length, uint nextflag) { for (; (int) key_length > 0; keyseg += 2 ) @@ -186,7 +186,7 @@ end: /* Calculates rectangle volume */ -double rtree_rect_volume(MI_KEYSEG *keyseg, uchar *a, uint key_length) +double rtree_rect_volume(HA_KEYSEG *keyseg, uchar *a, uint key_length) { double res = 1; for (; (int)key_length > 0; keyseg += 2) @@ -269,7 +269,7 @@ double rtree_rect_volume(MI_KEYSEG *keyseg, uchar *a, uint key_length) /* Creates an MBR as an array of doubles. */ -int rtree_d_mbr(MI_KEYSEG *keyseg, uchar *a, uint key_length, double *res) +int rtree_d_mbr(HA_KEYSEG *keyseg, uchar *a, uint key_length, double *res) { for (; (int)key_length > 0; keyseg += 2) { @@ -366,7 +366,7 @@ Creates common minimal bounding rectungle for two input rectagnles a and b Result is written to c */ -int rtree_combine_rect(MI_KEYSEG *keyseg, uchar* a, uchar* b, uchar* c, +int rtree_combine_rect(HA_KEYSEG *keyseg, uchar* a, uchar* b, uchar* c, uint key_length) { @@ -466,7 +466,7 @@ int rtree_combine_rect(MI_KEYSEG *keyseg, uchar* a, uchar* b, uchar* c, /* Calculates overlapping area of two MBRs a & b */ -double rtree_overlapping_area(MI_KEYSEG *keyseg, uchar* a, uchar* b, +double rtree_overlapping_area(HA_KEYSEG *keyseg, uchar* a, uchar* b, uint key_length) { double res = 1; @@ -559,7 +559,7 @@ double rtree_overlapping_area(MI_KEYSEG *keyseg, uchar* a, uchar* b, /* Calculates MBR_AREA(a+b) - MBR_AREA(a) */ -double rtree_area_increase(MI_KEYSEG *keyseg, uchar* a, uchar* b, +double rtree_area_increase(HA_KEYSEG *keyseg, uchar* a, uchar* b, uint key_length, double *ab_area) { double a_area = 1; @@ -675,7 +675,7 @@ double rtree_area_increase(MI_KEYSEG *keyseg, uchar* a, uchar* b, /* Calculates key page total MBR = MBR(key1) + MBR(key2) + ... */ -int rtree_page_mbr(MI_INFO *info, MI_KEYSEG *keyseg, uchar *page_buf, +int rtree_page_mbr(MI_INFO *info, HA_KEYSEG *keyseg, uchar *page_buf, uchar *c, uint key_length) { uint inc = 0; diff --git a/myisam/rt_mbr.h b/myisam/rt_mbr.h index 87af3b06c2e..a68807370f9 100644 --- a/myisam/rt_mbr.h +++ b/myisam/rt_mbr.h @@ -18,16 +18,16 @@ #ifndef _rt_mbr_h #define _rt_mbr_h -int rtree_key_cmp(MI_KEYSEG *keyseg, uchar *a, uchar *b, uint key_length, +int rtree_key_cmp(HA_KEYSEG *keyseg, uchar *a, uchar *b, uint key_length, uint nextflag); -int rtree_combine_rect(MI_KEYSEG *keyseg,uchar *, uchar *, uchar*, +int rtree_combine_rect(HA_KEYSEG *keyseg,uchar *, uchar *, uchar*, uint key_length); -double rtree_rect_volume(MI_KEYSEG *keyseg, uchar*, uint key_length); -int rtree_d_mbr(MI_KEYSEG *keyseg, uchar *a, uint key_length, double *res); -double rtree_overlapping_area(MI_KEYSEG *keyseg, uchar *a, uchar *b, +double rtree_rect_volume(HA_KEYSEG *keyseg, uchar*, uint key_length); +int rtree_d_mbr(HA_KEYSEG *keyseg, uchar *a, uint key_length, double *res); +double rtree_overlapping_area(HA_KEYSEG *keyseg, uchar *a, uchar *b, uint key_length); -double rtree_area_increase(MI_KEYSEG *keyseg, uchar *a, uchar *b, +double rtree_area_increase(HA_KEYSEG *keyseg, uchar *a, uchar *b, uint key_length, double *ab_area); -int rtree_page_mbr(MI_INFO *info, MI_KEYSEG *keyseg, uchar *page_buf, +int rtree_page_mbr(MI_INFO *info, HA_KEYSEG *keyseg, uchar *page_buf, uchar* c, uint key_length); #endif /* _rt_mbr_h */ diff --git a/myisam/rt_test.c b/myisam/rt_test.c index b18ec1fc857..4cc60d63031 100644 --- a/myisam/rt_test.c +++ b/myisam/rt_test.c @@ -47,7 +47,7 @@ int run_test(const char *filename) MI_CREATE_INFO create_info; MI_COLUMNDEF recinfo[20]; MI_KEYDEF keyinfo[20]; - MI_KEYSEG keyseg[20]; + HA_KEYSEG keyseg[20]; int silent=0; int opt_unique=0; diff --git a/myisam/sp_key.c b/myisam/sp_key.c index 0230ce04f76..2ab11f993c3 100644 --- a/myisam/sp_key.c +++ b/myisam/sp_key.c @@ -33,7 +33,7 @@ static int sp_mbr_from_wkb(uchar (*wkb), uint size, uint n_dims, double *mbr); uint sp_make_key(register MI_INFO *info, uint keynr, uchar *key, const byte *record, my_off_t filepos) { - MI_KEYSEG *keyseg; + HA_KEYSEG *keyseg; MI_KEYDEF *keyinfo = &info->s->keyinfo[keynr]; uint len = 0; byte *pos; diff --git a/myisam/sp_test.c b/myisam/sp_test.c index 9fc130eb6de..9d32b3e623d 100644 --- a/myisam/sp_test.c +++ b/myisam/sp_test.c @@ -56,7 +56,7 @@ int run_test(const char *filename) MI_CREATE_INFO create_info; MI_COLUMNDEF recinfo[20]; MI_KEYDEF keyinfo[20]; - MI_KEYSEG keyseg[20]; + HA_KEYSEG keyseg[20]; int silent=0; int create_flag=0; diff --git a/myisammrg/myrg_queue.c b/myisammrg/myrg_queue.c index b4f729fc2cf..08a248bdd64 100644 --- a/myisammrg/myrg_queue.c +++ b/myisammrg/myrg_queue.c @@ -23,7 +23,7 @@ static int queue_key_cmp(void *keyseg, byte *a, byte *b) MI_INFO *aa=((MYRG_TABLE *)a)->table; MI_INFO *bb=((MYRG_TABLE *)b)->table; uint not_used; - int ret= _mi_key_cmp((MI_KEYSEG *)keyseg, aa->lastkey, bb->lastkey, + int ret= ha_key_cmp((HA_KEYSEG *)keyseg, aa->lastkey, bb->lastkey, USE_WHOLE_KEY, SEARCH_FIND, ¬_used); return ret < 0 ? -1 : ret > 0 ? 1 : 0; } /* queue_key_cmp */ diff --git a/mysys/my_handler.c b/mysys/my_handler.c index afaada615b4..5544c7cc483 100644 --- a/mysys/my_handler.c +++ b/mysys/my_handler.c @@ -67,7 +67,7 @@ Returns <0, 0, >0 acording to which is bigger Key_length specifies length of key to use. Number-keys can't be splited If flag <> SEARCH_FIND compare also position */ -int _mi_key_cmp(register MI_KEYSEG *keyseg, register uchar *a, +int ha_key_cmp(register HA_KEYSEG *keyseg, register uchar *a, register uchar *b, uint key_length, uint nextflag, uint *diff_pos) { @@ -393,7 +393,7 @@ Returns <0, 0, >0 acording to which is bigger Key_length specifies length of key to use. Number-keys can't be splited If flag <> SEARCH_FIND compare also position */ -int hp_rb_key_cmp(register MI_KEYSEG *keyseg, register uchar *a, +int hp_rb_key_cmp(register HA_KEYSEG *keyseg, register uchar *a, register uchar *b, uint key_length, uint nextflag, uint *diff_pos) { diff --git a/sql/ha_heap.cc b/sql/ha_heap.cc index 8a4758aa558..1abaa63de68 100644 --- a/sql/ha_heap.cc +++ b/sql/ha_heap.cc @@ -36,7 +36,7 @@ int ha_heap::open(const char *name, int mode, uint test_if_locked) uint key,parts,mem_per_row=0; ulong max_rows; HP_KEYDEF *keydef; - MI_KEYSEG *seg; + HA_KEYSEG *seg; for (key=parts=0 ; key < table->keys ; key++) { @@ -48,9 +48,9 @@ int ha_heap::open(const char *name, int mode, uint test_if_locked) } if (!(keydef=(HP_KEYDEF*) my_malloc(table->keys*sizeof(HP_KEYDEF)+ - parts*sizeof(MI_KEYSEG),MYF(MY_WME)))) + parts*sizeof(HA_KEYSEG),MYF(MY_WME)))) return my_errno; - seg=my_reinterpret_cast(MI_KEYSEG*) (keydef+table->keys); + seg=my_reinterpret_cast(HA_KEYSEG*) (keydef+table->keys); for (key=0 ; key < table->keys ; key++) { KEY *pos=table->key_info+key; diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc index 3def79dc67f..a8bbc03aa91 100644 --- a/sql/ha_myisam.cc +++ b/sql/ha_myisam.cc @@ -993,7 +993,7 @@ int ha_myisam::create(const char *name, register TABLE *table, KEY *pos; MI_KEYDEF *keydef; MI_COLUMNDEF *recinfo,*recinfo_pos; - MI_KEYSEG *keyseg; + HA_KEYSEG *keyseg; uint options=table->db_options_in_use; DBUG_ENTER("ha_myisam::create"); @@ -1002,7 +1002,7 @@ int ha_myisam::create(const char *name, register TABLE *table, &recinfo,(table->fields*2+2)*sizeof(MI_COLUMNDEF), &keydef, table->keys*sizeof(MI_KEYDEF), &keyseg, - ((table->key_parts + table->keys) * sizeof(MI_KEYSEG)), + ((table->key_parts + table->keys) * sizeof(HA_KEYSEG)), 0))) DBUG_RETURN(1); diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 2abefe0aac5..2599fe216c5 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -3942,7 +3942,7 @@ static bool create_myisam_tmp_table(TABLE *table,TMP_TABLE_PARAM *param, if (table->keys) { // Get keys for ni_create bool using_unique_constraint=0; - MI_KEYSEG *seg= (MI_KEYSEG*) sql_calloc(sizeof(*seg) * + HA_KEYSEG *seg= (HA_KEYSEG*) sql_calloc(sizeof(*seg) * keyinfo->key_parts); if (!seg) goto err; |