00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "heap_priv.h"
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 int heap_rsame(register HP_INFO *info, unsigned char *record, int inx)
00029 {
00030 HP_SHARE *share= info->getShare();
00031
00032 test_active(info);
00033 if (get_chunk_status(&share->recordspace, info->current_ptr) == CHUNK_STATUS_ACTIVE)
00034 {
00035 if (inx < -1 || inx >= (int) share->keys)
00036 {
00037 return(errno= drizzled::HA_ERR_WRONG_INDEX);
00038 }
00039 else if (inx != -1)
00040 {
00041 info->lastinx=inx;
00042 hp_make_key(share->keydef + inx, &info->lastkey[0], record);
00043 if (!hp_search(info, share->keydef + inx, &info->lastkey[0], 3))
00044 {
00045 info->update=0;
00046 return(errno);
00047 }
00048 }
00049 hp_extract_record(share, record, info->current_ptr);
00050 return(0);
00051 }
00052 info->update=0;
00053
00054 return(errno= drizzled::HA_ERR_RECORD_DELETED);
00055 }