~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/heap/hp_rrnd.c

  • Committer: brian
  • Date: 2008-08-01 17:43:30 UTC
  • mfrom: (261.1.8 drizzle)
  • Revision ID: brian@localhost.localdomain-20080801174330-3y6yxa7pxkzdir6p
Merge from downsource tree.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
    info->update= 0;
35
35
    return(my_errno= HA_ERR_END_OF_FILE);
36
36
  }
37
 
  if (!info->current_ptr[share->reclength])
 
37
  if (get_chunk_status(&share->recordspace, info->current_ptr) != CHUNK_STATUS_ACTIVE)
38
38
  {
 
39
    /* treat deleted and linked chunks as deleted */
39
40
    info->update= HA_STATE_PREV_FOUND | HA_STATE_NEXT_FOUND;
40
41
    return(my_errno=HA_ERR_RECORD_DELETED);
41
42
  }
42
43
  info->update=HA_STATE_PREV_FOUND | HA_STATE_NEXT_FOUND | HA_STATE_AKTIV;
43
 
  memcpy(record,info->current_ptr,(size_t) share->reclength);
 
44
  hp_extract_record(share, record, info->current_ptr);
44
45
  info->current_hash_ptr=0;                     /* Can't use rnext */
45
46
  return(0);
46
47
} /* heap_rrnd */
59
60
int heap_rrnd_old(register HP_INFO *info, uchar *record, ulong pos)
60
61
{
61
62
  HP_SHARE *share=info->s;
62
 
 
 
63
asdfasdf;
63
64
  info->lastinx= -1;
64
65
  if (pos == (ulong) -1)
65
66
  {
66
67
    pos= ++info->current_record;
67
68
    if (pos % share->block.records_in_block &&  /* Quick next record */
68
 
        pos < share->records+share->deleted &&
69
 
        (info->update & HA_STATE_PREV_FOUND))
 
69
      pos < share->used_chunk_count+share->deleted_chunk_count &&
 
70
            (info->update & HA_STATE_PREV_FOUND))
70
71
    {
71
 
      info->current_ptr+=share->block.recbuffer;
 
72
      info->current_ptr+=share->block.recbufferlen;
72
73
      goto end;
73
74
    }
74
75
  }
75
76
  else
76
77
    info->current_record=pos;
77
78
 
78
 
  if (pos >= share->records+share->deleted)
 
79
  if (pos >= share->used_chunk_count+share->deleted_chunk_count)
79
80
  {
80
81
    info->update= 0;
81
82
    return(my_errno= HA_ERR_END_OF_FILE);