~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/heap/hp_rnext.c

  • Committer: Stewart Smith
  • Date: 2009-01-12 05:43:13 UTC
  • mto: (784.1.4 for-brian)
  • mto: This revision was merged to the branch mainline in revision 785.
  • Revision ID: stewart@flamingspork.com-20090112054313-edk6kpf4l6kpz4j7
fix archive_basic for drizzle

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 next record with the same key */
19
21
 
20
 
int heap_rnext(HP_INFO *info, uchar *record)
 
22
int heap_rnext(HP_INFO *info, unsigned char *record)
21
23
{
22
 
  uchar *pos;
 
24
  unsigned char *pos;
23
25
  HP_SHARE *share=info->s;
24
26
  HP_KEYDEF *keyinfo;
25
 
  
 
27
 
26
28
  if (info->lastinx < 0)
27
29
    return(my_errno=HA_ERR_WRONG_INDEX);
28
30
 
69
71
      custom_arg.keyseg = keyinfo->seg;
70
72
      custom_arg.key_length = info->lastkey_len;
71
73
      custom_arg.search_flag = SEARCH_SAME | SEARCH_FIND;
72
 
      pos = tree_search_key(&keyinfo->rb_tree, info->lastkey, info->parents, 
 
74
      pos = tree_search_key(&keyinfo->rb_tree, info->lastkey, info->parents,
73
75
                           &info->last_pos, info->last_find_flag, &custom_arg);
74
76
    }
75
77
    if (pos)
76
78
    {
77
 
      memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos), 
78
 
             sizeof(uchar*));
 
79
      memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos),
 
80
             sizeof(unsigned char*));
79
81
      info->current_ptr = pos;
80
82
    }
81
83
    else