~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/heap/hp_rkey.c

  • Committer: Monty Taylor
  • Date: 2008-08-16 21:06:22 UTC
  • Revision ID: monty@inaugust.com-20080816210622-zpnn13unyinqzn72
Updated po files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
#include "heapdef.h"
17
17
 
18
 
#include <string.h>
19
 
 
20
 
int heap_rkey(HP_INFO *info, unsigned char *record, int inx, const unsigned char *key,
 
18
int heap_rkey(HP_INFO *info, uchar *record, int inx, const uchar *key, 
21
19
              key_part_map keypart_map, enum ha_rkey_function find_flag)
22
20
{
23
 
  unsigned char *pos;
 
21
  uchar *pos;
24
22
  HP_SHARE *share= info->s;
25
23
  HP_KEYDEF *keyinfo= share->keydef + inx;
26
24
 
29
27
    return(my_errno= HA_ERR_WRONG_INDEX);
30
28
  }
31
29
  info->lastinx= inx;
32
 
  info->current_record= UINT32_MAX;             /* For heap_rrnd() */
 
30
  info->current_record= (uint32_t) ~0L;         /* For heap_rrnd() */
33
31
 
34
32
  if (keyinfo->algorithm == HA_KEY_ALG_BTREE)
35
33
  {
36
34
    heap_rb_param custom_arg;
37
35
 
38
36
    custom_arg.keyseg= info->s->keydef[inx].seg;
39
 
    custom_arg.key_length= info->lastkey_len=
40
 
      hp_rb_pack_key(keyinfo, (unsigned char*) info->lastkey,
41
 
                     (unsigned char*) key, keypart_map);
 
37
    custom_arg.key_length= info->lastkey_len= 
 
38
      hp_rb_pack_key(keyinfo, (uchar*) info->lastkey,
 
39
                     (uchar*) key, keypart_map);
42
40
    custom_arg.search_flag= SEARCH_FIND | SEARCH_SAME;
43
41
    /* for next rkey() after deletion */
44
42
    if (find_flag == HA_READ_AFTER_KEY)
53
51
      info->update= 0;
54
52
      return(my_errno= HA_ERR_KEY_NOT_FOUND);
55
53
    }
56
 
    memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos), sizeof(unsigned char*));
 
54
    memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos), sizeof(uchar*));
57
55
    info->current_ptr= pos;
58
56
  }
59
57
  else
74
72
 
75
73
        /* Quick find of record */
76
74
 
77
 
unsigned char* heap_find(HP_INFO *info, int inx, const unsigned char *key)
 
75
uchar* heap_find(HP_INFO *info, int inx, const uchar *key)
78
76
{
79
77
  return hp_search(info, info->s->keydef + inx, key, 0);
80
78
}