~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/heap/hp_rkey.cc

  • Committer: Brian Aker
  • Date: 2009-12-03 01:17:53 UTC
  • mto: (1237.3.2 push)
  • mto: This revision was merged to the branch mainline in revision 1238.
  • Revision ID: brian@gaz-20091203011753-159h2no5m5c5dt9b
Small cleanups, did in MERGE table only engine flag.

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
#include <string.h>
19
19
 
20
 
using namespace drizzled;
21
 
 
22
20
int heap_rkey(HP_INFO *info, unsigned char *record, int inx, const unsigned char *key,
23
21
              key_part_map keypart_map, enum ha_rkey_function find_flag)
24
22
{
28
26
 
29
27
  if ((uint) inx >= share->keys)
30
28
  {
31
 
    return(errno= HA_ERR_WRONG_INDEX);
 
29
    return(my_errno= HA_ERR_WRONG_INDEX);
32
30
  }
33
31
  info->lastinx= inx;
34
32
  info->current_record= UINT32_MAX;             /* For heap_rrnd() */
55
53
                                                find_flag, &custom_arg)))
56
54
    {
57
55
      info->update= 0;
58
 
      return(errno= HA_ERR_KEY_NOT_FOUND);
 
56
      return(my_errno= HA_ERR_KEY_NOT_FOUND);
59
57
    }
60
58
    memcpy(&pos, pos + (*keyinfo->get_key_length)(keyinfo, pos), sizeof(unsigned char*));
61
59
    info->current_ptr= pos;
65
63
    if (!(pos= hp_search(info, share->keydef + inx, key, 0)))
66
64
    {
67
65
      info->update= 0;
68
 
      return(errno);
 
66
      return(my_errno);
69
67
    }
70
68
    if (!(keyinfo->flag & HA_NOSAME))
71
69
      memcpy(info->lastkey, key, (size_t) keyinfo->length);