27 int heap_scan_init(
register HP_INFO *info)
29 DBUG_ENTER(
"heap_scan_init");
31 info->current_record= (ulong) ~0L;
41 DBUG_ENTER(
"heap_scan");
43 pos= ++info->current_record;
44 if (pos < info->next_block)
46 info->current_ptr+=share->block.recbuffer;
50 info->next_block+=share->block.records_in_block;
51 if (info->next_block >= share->records+share->deleted)
53 info->next_block= share->records+share->deleted;
54 if (pos >= info->next_block)
57 DBUG_RETURN(my_errno= HA_ERR_END_OF_FILE);
60 hp_find_record(info, pos);
62 if (!info->current_ptr[share->reclength])
64 DBUG_PRINT(
"warning",(
"Found deleted record"));
65 info->update= HA_STATE_PREV_FOUND | HA_STATE_NEXT_FOUND;
66 DBUG_RETURN(my_errno=HA_ERR_RECORD_DELETED);
68 info->update= HA_STATE_PREV_FOUND | HA_STATE_NEXT_FOUND | HA_STATE_AKTIV;
69 memcpy(record,info->current_ptr,(
size_t) share->reclength);
70 info->current_hash_ptr=0;