370
370
bmove_upp((uchar*) endpos+length,(uchar*) endpos,(uint) (endpos-keypos));
372
bmove(keypos,keypos-length, (int) (endpos-keypos)+length);
372
memcpy(keypos,keypos-length, (int) (endpos-keypos)+length);
373
373
(*keyinfo->store_key)(keyinfo,keypos,&s_temp);
374
374
/* Save pointer to next leaf */
375
375
if (!(*keyinfo->get_key)(keyinfo,share->base.key_reflength,&keypos,ret_key))
437
437
buff_length=mi_getint(buff);
439
439
/* find keys to make a big key-page */
440
bmove((uchar*) next_keypos-key_reflength,(uchar*) buff+2,
440
memcpy((uchar*) next_keypos-key_reflength,(uchar*) buff+2,
442
442
if (!_mi_get_last_key(info,keyinfo,anc_buff,anc_key,next_keypos,&length)
443
443
|| !_mi_get_last_key(info,keyinfo,leaf_buff,leaf_key,
444
444
leaf_buff+leaf_length,&length))
500
500
bmove_upp((uchar*) endpos+t_length,(uchar*) endpos,
501
501
(uint) (endpos-keypos));
503
bmove(keypos,keypos-t_length,(uint) (endpos-keypos)+t_length);
503
memcpy(keypos,keypos-t_length,(uint) (endpos-keypos)+t_length);
504
504
(*keyinfo->store_key)(keyinfo,keypos,&s_temp);
505
505
mi_putint(anc_buff,(anc_length+=t_length),key_reflength);
507
507
/* Store key first in new page */
509
bmove((uchar*) buff+2,(uchar*) half_pos-nod_flag,(size_t) nod_flag);
509
memcpy((uchar*) buff+2,(uchar*) half_pos-nod_flag,(size_t) nod_flag);
510
510
if (!(*keyinfo->get_key)(keyinfo,nod_flag,&half_pos,leaf_key))
512
512
t_length=(int) (*keyinfo->pack_key)(keyinfo, nod_flag, (uchar*) 0,
514
514
leaf_key, &s_temp);
515
515
/* t_length will always be > 0 for a new page !*/
516
516
length=(uint) ((buff+mi_getint(buff))-half_pos);
517
bmove((uchar*) buff+p_length+t_length,(uchar*) half_pos,(size_t) length);
517
memcpy((uchar*) buff+p_length+t_length,(uchar*) half_pos,(size_t) length);
518
518
(*keyinfo->store_key)(keyinfo,buff+p_length,&s_temp);
519
519
mi_putint(buff,length+t_length+p_length,nod_flag);
537
537
endpos=buff+buff_length;
539
539
/* find keys to make a big key-page */
540
bmove((uchar*) next_keypos - key_reflength,(uchar*) leaf_buff+2,
540
memcpy((uchar*) next_keypos - key_reflength,(uchar*) leaf_buff+2,
542
542
next_keypos=keypos;
543
543
if (!(*keyinfo->get_key)(keyinfo,key_reflength,&next_keypos,
554
554
prev_key, prev_key,
555
555
anc_key, &s_temp);
556
556
if (t_length >= 0)
557
bmove((uchar*) endpos+t_length,(uchar*) leaf_buff+p_length,
558
(size_t) (leaf_length-p_length));
557
memcpy((uchar*) endpos+t_length,(uchar*) leaf_buff+p_length,
558
(size_t) (leaf_length-p_length));
559
559
else /* We gained space */
560
bmove((uchar*) endpos,(uchar*) leaf_buff+((int) p_length-t_length),
561
(size_t) (leaf_length-p_length+t_length));
560
memcpy((uchar*) endpos,(uchar*) leaf_buff+((int) p_length-t_length),
561
(size_t) (leaf_length-p_length+t_length));
563
563
(*keyinfo->store_key)(keyinfo,endpos,&s_temp);
564
564
buff_length=buff_length+leaf_length-p_length+t_length;
601
601
bmove_upp((uchar*) temp_pos+t_length,(uchar*) temp_pos,
602
602
(uint) (temp_pos-keypos));
604
bmove(keypos,keypos-t_length,(uint) (temp_pos-keypos)+t_length);
604
memcpy(keypos,keypos-t_length,(uint) (temp_pos-keypos)+t_length);
605
605
(*keyinfo->store_key)(keyinfo,keypos,&s_temp);
606
606
mi_putint(anc_buff,(anc_length+=t_length),key_reflength);
608
608
/* Store first key on new page */
610
bmove((uchar*) leaf_buff+2,(uchar*) half_pos-nod_flag,(size_t) nod_flag);
610
memcpy((uchar*) leaf_buff+2,(uchar*) half_pos-nod_flag,(size_t) nod_flag);
611
611
if (!(length=(*keyinfo->get_key)(keyinfo,nod_flag,&half_pos,leaf_key)))
613
613
t_length=(*keyinfo->pack_key)(keyinfo,nod_flag, (uchar*) 0,
614
614
(uchar*) 0, (uchar*) 0, leaf_key, &s_temp);
615
615
length=(uint) ((buff+buff_length)-half_pos);
616
bmove((uchar*) leaf_buff+p_length+t_length,(uchar*) half_pos,
616
memcpy((uchar*) leaf_buff+p_length+t_length,(uchar*) half_pos,
617
617
(size_t) length);
618
618
(*keyinfo->store_key)(keyinfo,leaf_buff+p_length,&s_temp);
619
619
mi_putint(leaf_buff,length+t_length+p_length,nod_flag);
758
bmove((uchar*) start,(uchar*) start+s_length,
759
(uint) (page_end-start-s_length));
758
memcpy((uchar*) start,(uchar*) start+s_length,
759
(uint) (page_end-start-s_length));
760
760
return((uint) s_length);
761
761
} /* remove_key */