27 int heap_rrnd(
register HP_INFO *info, uchar *
record, uchar *pos)
30 DBUG_ENTER(
"heap_rrnd");
31 DBUG_PRINT(
"enter",(
"info: 0x%lx pos: %lx",(
long) info, (
long) pos));
34 if (!(info->current_ptr= pos))
37 DBUG_RETURN(my_errno= HA_ERR_END_OF_FILE);
39 if (!info->current_ptr[share->reclength])
41 info->update= HA_STATE_PREV_FOUND | HA_STATE_NEXT_FOUND;
42 DBUG_RETURN(my_errno=HA_ERR_RECORD_DELETED);
44 info->update=HA_STATE_PREV_FOUND | HA_STATE_NEXT_FOUND | HA_STATE_AKTIV;
45 memcpy(record,info->current_ptr,(
size_t) share->reclength);
46 DBUG_PRINT(
"exit", (
"found record at 0x%lx", (
long) info->current_ptr));
47 info->current_hash_ptr=0;
52 #ifdef WANT_OLD_HEAP_VERSION
62 int heap_rrnd_old(
register HP_INFO *info, uchar *record, ulong pos)
65 DBUG_ENTER(
"heap_rrnd");
66 DBUG_PRINT(
"enter",(
"info: 0x%lx pos: %ld",info,pos));
69 if (pos == (ulong) -1)
71 pos= ++info->current_record;
72 if (pos % share->block.records_in_block &&
73 pos < share->records+share->deleted &&
74 (info->update & HA_STATE_PREV_FOUND))
76 info->current_ptr+=share->block.recbuffer;
81 info->current_record=pos;
83 if (pos >= share->records+share->deleted)
86 DBUG_RETURN(my_errno= HA_ERR_END_OF_FILE);
90 hp_find_record(info, pos);
93 if (!info->current_ptr[share->reclength])
95 info->update= HA_STATE_PREV_FOUND | HA_STATE_NEXT_FOUND;
96 DBUG_RETURN(my_errno=HA_ERR_RECORD_DELETED);
98 info->update=HA_STATE_PREV_FOUND | HA_STATE_NEXT_FOUND | HA_STATE_AKTIV;
99 memcpy(record,info->current_ptr,(
size_t) share->reclength);
100 DBUG_PRINT(
"exit",(
"found record at 0x%lx",info->current_ptr));
101 info->current_hash_ptr=0;