~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_rkey.c

  • Committer: Monty Taylor
  • Date: 2008-10-16 06:32:30 UTC
  • mto: (511.1.5 codestyle)
  • mto: This revision was merged to the branch mainline in revision 521.
  • Revision ID: monty@inaugust.com-20081016063230-4brxsra0qsmsg84q
Added -Wunused-macros.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
        /* Read a record using key */
21
21
        /* Ordinary search_flag is 0 ; Give error if no record with key */
22
22
 
23
 
int mi_rkey(MI_INFO *info, uchar *buf, int inx, const uchar *key,
 
23
int mi_rkey(MI_INFO *info, unsigned char *buf, int inx, const unsigned char *key,
24
24
            key_part_map keypart_map, enum ha_rkey_function search_flag)
25
25
{
26
 
  uchar *key_buff;
 
26
  unsigned char *key_buff;
27
27
  MYISAM_SHARE *share=info->s;
28
28
  MI_KEYDEF *keyinfo;
29
29
  HA_KEYSEG *last_used_keyseg;
30
 
  uint pack_key_length, use_key_length, nextflag;
31
 
  uint myisam_search_flag;
 
30
  uint32_t pack_key_length, use_key_length, nextflag;
 
31
  uint32_t myisam_search_flag;
32
32
  int res= 0;
33
33
 
34
34
  if ((inx = _mi_check_index(info,inx)) < 0)
47
47
    */
48
48
    key_buff=info->lastkey+info->s->base.max_key_length;
49
49
    pack_key_length= keypart_map;
50
 
    bmove(key_buff, key, pack_key_length);
 
50
    memcpy(key_buff, key, pack_key_length);
51
51
    last_used_keyseg= info->s->keyinfo[inx].seg + info->last_used_keyseg;
52
52
  }
53
53
  else
55
55
    assert(keypart_map);
56
56
    /* Save the packed key for later use in the second buffer of lastkey. */
57
57
    key_buff=info->lastkey+info->s->base.max_key_length;
58
 
    pack_key_length=_mi_pack_key(info,(uint) inx, key_buff, (uchar*) key,
 
58
    pack_key_length=_mi_pack_key(info,(uint) inx, key_buff, (unsigned char*) key,
59
59
                                 keypart_map, &last_used_keyseg);
60
60
    /* Save packed_key_length for use by the MERGE engine. */
61
61
    info->pack_key_length= pack_key_length;
62
 
    info->last_used_keyseg= (uint16) (last_used_keyseg -
 
62
    info->last_used_keyseg= (uint16_t) (last_used_keyseg -
63
63
                                      info->s->keyinfo[inx].seg);
64
64
  }
65
65
 
104
104
             (info->index_cond_func && 
105
105
              !(res= mi_check_index_cond(info, inx, buf))))
106
106
      {
107
 
        uint not_used[2];
 
107
        uint32_t not_used[2];
108
108
        /*
109
109
          Skip rows that are inserted by other threads since we got a lock
110
110
          Note that this can only happen if we are not searching after an
175
175
  /* Store last used key as a base for read next */
176
176
  memcpy(info->lastkey,key_buff,pack_key_length);
177
177
  info->last_rkey_length= pack_key_length;
178
 
  bzero((char*) info->lastkey+pack_key_length,info->s->base.rec_reflength);
 
178
  memset(info->lastkey+pack_key_length, 0, info->s->base.rec_reflength);
179
179
  info->lastkey_length=pack_key_length+info->s->base.rec_reflength;
180
180
 
181
181
  if (search_flag == HA_READ_AFTER_KEY)