~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/heap/hp_scan.cc

  • Committer: Brian Aker
  • Date: 2010-01-22 00:53:13 UTC
  • Revision ID: brian@gaz-20100122005313-jmizcbcdi1lt4tcx
Revert db patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
/* Scan through all rows */
17
17
 
18
 
#include "heapdef.h"
 
18
#include "heap_priv.h"
19
19
 
20
20
/*
21
21
           Returns one of following values:
27
27
int heap_scan_init(register HP_INFO *info)
28
28
{
29
29
  info->lastinx= -1;
30
 
  info->current_record= (uint32_t) ~0L;         /* No current record */
 
30
  info->current_record= UINT32_MAX;             /* 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, uchar *record)
 
36
int heap_scan(register HP_INFO *info, unsigned char *record)
37
37
{
38
38
  HP_SHARE *share=info->s;
39
39
  uint32_t pos;
52
52
      if (pos >= info->next_block)
53
53
      {
54
54
        info->update= 0;
55
 
        return(my_errno= HA_ERR_END_OF_FILE);
 
55
        return(errno= HA_ERR_END_OF_FILE);
56
56
      }
57
57
    }
58
58
    hp_find_record(info, pos);
60
60
  if (get_chunk_status(&share->recordspace, info->current_ptr) != CHUNK_STATUS_ACTIVE)
61
61
  {
62
62
    info->update= HA_STATE_PREV_FOUND | HA_STATE_NEXT_FOUND;
63
 
    return(my_errno=HA_ERR_RECORD_DELETED);
 
63
    return(errno=HA_ERR_RECORD_DELETED);
64
64
  }
65
65
  info->update= HA_STATE_PREV_FOUND | HA_STATE_NEXT_FOUND | HA_STATE_AKTIV;
66
66
  hp_extract_record(share, record, info->current_ptr);