~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/heap/hp_scan.c

Renamed strings to mystrings, for include/lib naming consistency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
int heap_scan_init(register HP_INFO *info)
28
28
{
29
29
  info->lastinx= -1;
30
 
  info->current_record= UINT32_MAX;             /* No current record */
 
30
  info->current_record= (ulong) ~0L;            /* No current record */
31
31
  info->update=0;
32
32
  info->next_block=0;
33
33
  return(0);
34
34
}
35
35
 
36
 
int heap_scan(register HP_INFO *info, unsigned char *record)
 
36
int heap_scan(register HP_INFO *info, uchar *record)
37
37
{
38
38
  HP_SHARE *share=info->s;
39
 
  uint32_t pos;
 
39
  ulong pos;
40
40
 
41
41
  pos= ++info->current_record;
42
42
  if (pos < info->next_block)
43
43
  {
44
 
    info->current_ptr+=share->recordspace.block.recbuffer;
 
44
    info->current_ptr+=share->block.recbuffer;
45
45
  }
46
46
  else
47
47
  {
48
 
    info->next_block+=share->recordspace.block.records_in_block;
49
 
    if (info->next_block >= share->recordspace.chunk_count)
 
48
    info->next_block+=share->block.records_in_block;
 
49
    if (info->next_block >= share->records+share->deleted)
50
50
    {
51
 
      info->next_block= share->recordspace.chunk_count;
 
51
      info->next_block= share->records+share->deleted;
52
52
      if (pos >= info->next_block)
53
53
      {
54
54
        info->update= 0;
57
57
    }
58
58
    hp_find_record(info, pos);
59
59
  }
60
 
  if (get_chunk_status(&share->recordspace, info->current_ptr) != CHUNK_STATUS_ACTIVE)
 
60
  if (!info->current_ptr[share->reclength])
61
61
  {
62
62
    info->update= HA_STATE_PREV_FOUND | HA_STATE_NEXT_FOUND;
63
63
    return(my_errno=HA_ERR_RECORD_DELETED);
64
64
  }
65
65
  info->update= HA_STATE_PREV_FOUND | HA_STATE_NEXT_FOUND | HA_STATE_AKTIV;
66
 
  hp_extract_record(share, record, info->current_ptr);
 
66
  memcpy(record,info->current_ptr,(size_t) share->reclength);
67
67
  info->current_hash_ptr=0;                     /* Can't use read_next */
68
68
  return(0);
69
69
} /* heap_scan */