~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/heap/hp_rfirst.c

  • Committer: Brian Aker
  • Date: 2009-02-20 22:48:37 UTC
  • Revision ID: brian@tangent.org-20090220224837-fw5wrf46n4ru3e6a
First pass of stripping uint

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
 
18
20
/* Read first record with the current key */
19
21
 
20
22
int heap_rfirst(HP_INFO *info, unsigned char *record, int inx)
21
23
{
22
24
  HP_SHARE *share = info->s;
23
25
  HP_KEYDEF *keyinfo = share->keydef + inx;
24
 
  
 
26
 
25
27
  info->lastinx= inx;
26
28
  if (keyinfo->algorithm == HA_KEY_ALG_BTREE)
27
29
  {
30
32
    if ((pos = tree_search_edge(&keyinfo->rb_tree, info->parents,
31
33
                                &info->last_pos, offsetof(TREE_ELEMENT, left))))
32
34
    {
33
 
      memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos), 
 
35
      memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos),
34
36
             sizeof(unsigned char*));
35
37
      info->current_ptr = pos;
36
38
      hp_extract_record(share, record, pos);