~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_search.c

  • Committer: Mark Atwood
  • Date: 2009-01-05 04:37:22 UTC
  • mto: (758.1.1 devel)
  • mto: This revision was merged to the branch mainline in revision 759.
  • Revision ID: me@mark.atwood.name-20090105043722-03l4mzcxi4yjjjih
replace sql_print_error etc with errmsg_print

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
#include "myisamdef.h"
19
19
#include <mystrings/m_ctype.h>
 
20
#include <mystrings/m_string.h>
 
21
#include <drizzled/util/test.h>
20
22
 
21
23
static bool _mi_get_prev_key(MI_INFO *info, MI_KEYDEF *keyinfo, unsigned char *page,
22
24
                                unsigned char *key, unsigned char *keypos,
803
805
        }
804
806
        else if (tot_length < 255 && *start == 255)
805
807
        {
806
 
          memcpy(key+1,key+3,length);
 
808
          memmove(key+1,key+3,length);
807
809
          *key=tot_length;
808
810
          key+=1+length;
809
811
        }
859
861
    page+=length;
860
862
  }
861
863
  length=keyseg->length+nod_flag;
862
 
  memcpy(key,page,length);
 
864
  memmove(key,page,length);
863
865
  *page_pos= page+length;
864
866
  return ((uint) (key-start_key)+keyseg->length);
865
867
} /* _mi_get_pack_key */
1002
1004
  nod_flag=mi_test_if_nod(page);
1003
1005
  if (! (keyinfo->flag & (HA_VAR_LENGTH_KEY | HA_BINARY_PACK_KEY)))
1004
1006
  {
1005
 
    memcpy(key,keypos,keyinfo->keylength+nod_flag);
 
1007
    memmove(key,keypos,keyinfo->keylength+nod_flag);
1006
1008
    return(keypos+keyinfo->keylength+nod_flag);
1007
1009
  }
1008
1010
  else
1037
1039
  if (! (keyinfo->flag & (HA_VAR_LENGTH_KEY | HA_BINARY_PACK_KEY)))
1038
1040
  {
1039
1041
    *return_key_length=keyinfo->keylength;
1040
 
    memcpy(key, keypos - *return_key_length-nod_flag, *return_key_length);
 
1042
    memmove(key, keypos - *return_key_length-nod_flag, *return_key_length);
1041
1043
    return(0);
1042
1044
  }
1043
1045
  else
1075
1077
    lastpos=endpos-keyinfo->keylength-nod_flag;
1076
1078
    *return_key_length=keyinfo->keylength;
1077
1079
    if (lastpos > page)
1078
 
      memcpy(lastkey,lastpos,keyinfo->keylength+nod_flag);
 
1080
      memmove(lastkey,lastpos,keyinfo->keylength+nod_flag);
1079
1081
  }
1080
1082
  else
1081
1083
  {
1779
1781
  }
1780
1782
  assert(key_pos >= start);
1781
1783
  length= s_temp->totlength - (key_pos - start);
1782
 
  memcpy(key_pos, s_temp->key, length);
 
1784
  memmove(key_pos, s_temp->key, length);
1783
1785
 
1784
1786
  if (!s_temp->next_key_pos)                    /* No following key */
1785
1787
    return;