~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/heap/hp_rrnd.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:
27
27
int heap_rrnd(register HP_INFO *info, uchar *record, uchar *pos)
28
28
{
29
29
  HP_SHARE *share=info->s;
30
 
  DBUG_ENTER("heap_rrnd");
31
 
  DBUG_PRINT("enter",("info: 0x%lx  pos: %lx",(long) info, (long) pos));
32
30
 
33
31
  info->lastinx= -1;
34
32
  if (!(info->current_ptr= pos))
35
33
  {
36
34
    info->update= 0;
37
 
    DBUG_RETURN(my_errno= HA_ERR_END_OF_FILE);
 
35
    return(my_errno= HA_ERR_END_OF_FILE);
38
36
  }
39
37
  if (!info->current_ptr[share->reclength])
40
38
  {
41
39
    info->update= HA_STATE_PREV_FOUND | HA_STATE_NEXT_FOUND;
42
 
    DBUG_RETURN(my_errno=HA_ERR_RECORD_DELETED);
 
40
    return(my_errno=HA_ERR_RECORD_DELETED);
43
41
  }
44
42
  info->update=HA_STATE_PREV_FOUND | HA_STATE_NEXT_FOUND | HA_STATE_AKTIV;
45
43
  memcpy(record,info->current_ptr,(size_t) share->reclength);
46
 
  DBUG_PRINT("exit", ("found record at 0x%lx", (long) info->current_ptr));
47
44
  info->current_hash_ptr=0;                     /* Can't use rnext */
48
 
  DBUG_RETURN(0);
 
45
  return(0);
49
46
} /* heap_rrnd */
50
47
 
51
48
 
62
59
int heap_rrnd_old(register HP_INFO *info, uchar *record, ulong pos)
63
60
{
64
61
  HP_SHARE *share=info->s;
65
 
  DBUG_ENTER("heap_rrnd");
66
 
  DBUG_PRINT("enter",("info: 0x%lx  pos: %ld",info,pos));
67
62
 
68
63
  info->lastinx= -1;
69
64
  if (pos == (ulong) -1)
83
78
  if (pos >= share->records+share->deleted)
84
79
  {
85
80
    info->update= 0;
86
 
    DBUG_RETURN(my_errno= HA_ERR_END_OF_FILE);
 
81
    return(my_errno= HA_ERR_END_OF_FILE);
87
82
  }
88
83
 
89
84
        /* Find record number pos */
93
88
  if (!info->current_ptr[share->reclength])
94
89
  {
95
90
    info->update= HA_STATE_PREV_FOUND | HA_STATE_NEXT_FOUND;
96
 
    DBUG_RETURN(my_errno=HA_ERR_RECORD_DELETED);
 
91
    return(my_errno=HA_ERR_RECORD_DELETED);
97
92
  }
98
93
  info->update=HA_STATE_PREV_FOUND | HA_STATE_NEXT_FOUND | HA_STATE_AKTIV;
99
94
  memcpy(record,info->current_ptr,(size_t) share->reclength);
100
 
  DBUG_PRINT("exit",("found record at 0x%lx",info->current_ptr));
101
95
  info->current_hash_ptr=0;                     /* Can't use rnext */
102
 
  DBUG_RETURN(0);
 
96
  return(0);
103
97
} /* heap_rrnd */
104
98
 
105
99
#endif /* WANT_OLD_HEAP_VERSION */