~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/heap/hp_clear.c

  • Committer: Jay Pipes
  • Date: 2008-07-17 17:54:00 UTC
  • mto: This revision was merged to the branch mainline in revision 182.
  • Revision ID: jay@mysql.com-20080717175400-xm2aazihjra8mdzq
Removal of DBUG from libdrizzle/ - Round 2

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
void hp_clear(HP_SHARE *info)
30
30
{
31
 
  hp_clear_dataspace(&info->recordspace);
 
31
  if (info->block.levels)
 
32
    VOID(hp_free_level(&info->block,info->block.levels,info->block.root,
 
33
                        (uchar*) 0));
 
34
  info->block.levels=0;
32
35
  hp_clear_keys(info);
33
 
  info->records= 0;
 
36
  info->records= info->deleted= 0;
 
37
  info->data_length= 0;
34
38
  info->blength=1;
35
39
  info->changed=0;
 
40
  info->del_link=0;
36
41
  return;
37
42
}
38
43
 
73
78
 
74
79
void hp_clear_keys(HP_SHARE *info)
75
80
{
76
 
  uint32_t key;
 
81
  uint key;
77
82
 
78
83
  for (key=0 ; key < info->keys ; key++)
79
84
  {
86
91
    {
87
92
      HP_BLOCK *block= &keyinfo->block;
88
93
      if (block->levels)
89
 
        hp_free_level(block,block->levels,block->root,(unsigned char*) 0);
 
94
        VOID(hp_free_level(block,block->levels,block->root,(uchar*) 0));
90
95
      block->levels=0;
91
96
      block->last_allocated=0;
92
97
      keyinfo->hash_buckets= 0;
149
154
  int error= 0;
150
155
  HP_SHARE *share= info->s;
151
156
 
152
 
  if (share->recordspace.total_data_length || share->index_length)
 
157
  if (share->data_length || share->index_length)
153
158
    error= HA_ERR_CRASHED;
154
159
  else
155
160
    if (share->currently_disabled_keys)
183
188
 
184
189
  return (! share->keys && share->currently_disabled_keys);
185
190
}
 
191