~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/heap/hp_delete.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
/* remove current record in heap-database */
17
17
 
18
 
#include "heapdef.h"
 
18
#include "heap_priv.h"
19
19
 
20
 
int heap_delete(HP_INFO *info, const uchar *record)
 
20
int heap_delete(HP_INFO *info, const unsigned char *record)
21
21
{
22
 
  uchar *pos;
 
22
  unsigned char *pos;
23
23
  HP_SHARE *share=info->s;
24
24
  HP_KEYDEF *keydef, *end, *p_lastinx;
25
 
  uint rec_length, chunk_count;
 
25
  uint32_t rec_length, chunk_count;
26
26
 
27
27
  test_active(info);
28
28
 
29
29
  if (info->opt_flag & READ_CHECK_USED)
30
 
    return(my_errno);                   /* Record changed */
 
30
    return(errno);                      /* Record changed */
31
31
  share->changed=1;
32
32
 
33
33
  rec_length = hp_get_encoded_data_length(share, record, &chunk_count);
36
36
  pos=info->current_ptr;
37
37
 
38
38
  p_lastinx = share->keydef + info->lastinx;
39
 
  for (keydef = share->keydef, end = keydef + share->keys; keydef < end; 
 
39
  for (keydef = share->keydef, end = keydef + share->keys; keydef < end;
40
40
       keydef++)
41
41
  {
42
42
    if ((*keydef->delete_key)(info, keydef, record, pos, keydef == p_lastinx))
51
51
err:
52
52
  if (++(share->records) == share->blength)
53
53
    share->blength+= share->blength;
54
 
  return(my_errno);
 
54
  return(errno);
55
55
}
56
56
 
57
57
 
60
60
*/
61
61
 
62
62
int hp_rb_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo,
63
 
                   const uchar *record, uchar *recpos, int flag)
 
63
                   const unsigned char *record, unsigned char *recpos, int flag)
64
64
{
65
65
  heap_rb_param custom_arg;
66
 
  uint old_allocated;
 
66
  uint32_t old_allocated;
67
67
  int res;
68
68
 
69
 
  if (flag) 
 
69
  if (flag)
70
70
    info->last_pos= NULL; /* For heap_rnext/heap_rprev */
71
71
 
72
72
  custom_arg.keyseg= keyinfo->seg;
97
97
*/
98
98
 
99
99
int hp_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo,
100
 
                  const uchar *record, uchar *recpos, int flag)
 
100
                  const unsigned char *record, unsigned char *recpos, int flag)
101
101
{
102
102
  uint32_t blength,pos2,pos_hashnr,lastpos_hashnr;
103
103
  HASH_INFO *lastpos,*gpos,*pos,*pos3,*empty,*last_ptr;
125
125
    gpos=pos;
126
126
    if (!(pos=pos->next_key))
127
127
    {
128
 
      return(my_errno=HA_ERR_CRASHED);  /* This shouldn't happend */
 
128
      return(errno=HA_ERR_CRASHED);     /* This shouldn't happend */
129
129
    }
130
130
  }
131
131