~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/heap/hp_rrnd.c

  • Committer: Brian Aker
  • Date: 2008-12-19 07:02:38 UTC
  • Revision ID: brian@tangent.org-20081219070238-569uxp3vsr6r37v1
Updated/fix to foreign key test.

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
 
16
16
/* Read a record from a random position */
17
17
 
18
 
#include "heap_priv.h"
 
18
#include "heapdef.h"
19
19
 
20
20
/*
21
21
           Returns one of following values:
32
32
  if (!(info->current_ptr= pos))
33
33
  {
34
34
    info->update= 0;
35
 
    return(errno= HA_ERR_END_OF_FILE);
 
35
    return(my_errno= HA_ERR_END_OF_FILE);
36
36
  }
37
37
  if (get_chunk_status(&share->recordspace, info->current_ptr) != CHUNK_STATUS_ACTIVE)
38
38
  {
39
39
    /* treat deleted and linked chunks as deleted */
40
40
    info->update= HA_STATE_PREV_FOUND | HA_STATE_NEXT_FOUND;
41
 
    return(errno=HA_ERR_RECORD_DELETED);
 
41
    return(my_errno=HA_ERR_RECORD_DELETED);
42
42
  }
43
43
  info->update=HA_STATE_PREV_FOUND | HA_STATE_NEXT_FOUND | HA_STATE_AKTIV;
44
44
  hp_extract_record(share, record, info->current_ptr);
79
79
  if (pos >= share->used_chunk_count+share->deleted_chunk_count)
80
80
  {
81
81
    info->update= 0;
82
 
    return(errno= HA_ERR_END_OF_FILE);
 
82
    return(my_errno= HA_ERR_END_OF_FILE);
83
83
  }
84
84
 
85
85
        /* Find record number pos */
89
89
  if (!info->current_ptr[share->reclength])
90
90
  {
91
91
    info->update= HA_STATE_PREV_FOUND | HA_STATE_NEXT_FOUND;
92
 
    return(errno=HA_ERR_RECORD_DELETED);
 
92
    return(my_errno=HA_ERR_RECORD_DELETED);
93
93
  }
94
94
  info->update=HA_STATE_PREV_FOUND | HA_STATE_NEXT_FOUND | HA_STATE_AKTIV;
95
95
  memcpy(record,info->current_ptr,(size_t) share->reclength);