~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/heap/hp_clear.c

  • Committer: Brian Aker
  • Date: 2008-07-14 22:40:46 UTC
  • Revision ID: brian@tangent.org-20080714224046-x183907w9wp1txwv
Removed sql_manager. Ever heard of just setting up the OS to sync when you
want it to?

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