~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/heap/hp_scan.c

  • Committer: Brian Aker
  • Date: 2008-07-18 20:10:26 UTC
  • mfrom: (51.3.29 remove-dbug)
  • Revision ID: brian@tangent.org-20080718201026-tto5golt0xhwqe4a
Merging in Jay's final patch on dbug.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
 
27
27
int heap_scan_init(register HP_INFO *info)
28
28
{
29
 
  DBUG_ENTER("heap_scan_init");
30
29
  info->lastinx= -1;
31
30
  info->current_record= (ulong) ~0L;            /* No current record */
32
31
  info->update=0;
33
32
  info->next_block=0;
34
 
  DBUG_RETURN(0);
 
33
  return(0);
35
34
}
36
35
 
37
36
int heap_scan(register HP_INFO *info, uchar *record)
38
37
{
39
38
  HP_SHARE *share=info->s;
40
39
  ulong pos;
41
 
  DBUG_ENTER("heap_scan");
42
40
 
43
41
  pos= ++info->current_record;
44
42
  if (pos < info->next_block)
54
52
      if (pos >= info->next_block)
55
53
      {
56
54
        info->update= 0;
57
 
        DBUG_RETURN(my_errno= HA_ERR_END_OF_FILE);
 
55
        return(my_errno= HA_ERR_END_OF_FILE);
58
56
      }
59
57
    }
60
58
    hp_find_record(info, pos);
61
59
  }
62
60
  if (!info->current_ptr[share->reclength])
63
61
  {
64
 
    DBUG_PRINT("warning",("Found deleted record"));
65
62
    info->update= HA_STATE_PREV_FOUND | HA_STATE_NEXT_FOUND;
66
 
    DBUG_RETURN(my_errno=HA_ERR_RECORD_DELETED);
 
63
    return(my_errno=HA_ERR_RECORD_DELETED);
67
64
  }
68
65
  info->update= HA_STATE_PREV_FOUND | HA_STATE_NEXT_FOUND | HA_STATE_AKTIV;
69
66
  memcpy(record,info->current_ptr,(size_t) share->reclength);
70
67
  info->current_hash_ptr=0;                     /* Can't use read_next */
71
 
  DBUG_RETURN(0);
 
68
  return(0);
72
69
} /* heap_scan */