~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/heap/hp_clear.c

  • Committer: Monty Taylor
  • Date: 2008-10-16 06:32:30 UTC
  • mto: (511.1.5 codestyle)
  • mto: This revision was merged to the branch mainline in revision 521.
  • Revision ID: monty@inaugust.com-20081016063230-4brxsra0qsmsg84q
Added -Wunused-macros.

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
 
  DBUG_ENTER("hp_clear");
32
 
 
33
 
  if (info->block.levels)
34
 
    VOID(hp_free_level(&info->block,info->block.levels,info->block.root,
35
 
                        (uchar*) 0));
36
 
  info->block.levels=0;
 
31
  hp_clear_dataspace(&info->recordspace);
37
32
  hp_clear_keys(info);
38
 
  info->records= info->deleted= 0;
39
 
  info->data_length= 0;
 
33
  info->records= 0;
40
34
  info->blength=1;
41
35
  info->changed=0;
42
 
  info->del_link=0;
43
 
  DBUG_VOID_RETURN;
 
36
  return;
44
37
}
45
38
 
46
39
 
80
73
 
81
74
void hp_clear_keys(HP_SHARE *info)
82
75
{
83
 
  uint key;
84
 
  DBUG_ENTER("hp_clear_keys");
 
76
  uint32_t key;
85
77
 
86
78
  for (key=0 ; key < info->keys ; key++)
87
79
  {
94
86
    {
95
87
      HP_BLOCK *block= &keyinfo->block;
96
88
      if (block->levels)
97
 
        VOID(hp_free_level(block,block->levels,block->root,(uchar*) 0));
 
89
        hp_free_level(block,block->levels,block->root,(unsigned char*) 0);
98
90
      block->levels=0;
99
91
      block->last_allocated=0;
100
92
      keyinfo->hash_buckets= 0;
101
93
    }
102
94
  }
103
95
  info->index_length=0;
104
 
  DBUG_VOID_RETURN;
 
96
  return;
105
97
}
106
98
 
107
99
 
157
149
  int error= 0;
158
150
  HP_SHARE *share= info->s;
159
151
 
160
 
  if (share->data_length || share->index_length)
 
152
  if (share->recordspace.total_data_length || share->index_length)
161
153
    error= HA_ERR_CRASHED;
162
154
  else
163
155
    if (share->currently_disabled_keys)
191
183
 
192
184
  return (! share->keys && share->currently_disabled_keys);
193
185
}
194