22#include <drizzled/error_t.h>
27static void hp_clear_keys(HP_SHARE *info);
29void heap_clear(HP_INFO *info)
31 hp_clear(info->getShare());
34void hp_clear(HP_SHARE *info)
36 hp_clear_dataspace(&info->recordspace);
58static void hp_clear_keys(HP_SHARE *info)
60 for (uint32_t key=0 ; key < info->keys ; key++)
62 HP_KEYDEF *keyinfo = info->keydef + key;
64 HP_BLOCK *block= &keyinfo->block;
66 hp_free_level(block,block->levels,block->root,(
unsigned char*) 0);
68 block->last_allocated=0;
69 keyinfo->hash_buckets= 0;
90int heap_disable_indexes(HP_INFO *info)
92 HP_SHARE *share= info->getShare();
97 share->currently_disabled_keys= share->keys;
123int heap_enable_indexes(HP_INFO *info)
126 HP_SHARE *share= info->getShare();
128 if (share->recordspace.total_data_length || share->index_length)
129 error= HA_ERR_CRASHED;
131 if (share->currently_disabled_keys)
133 share->keys= share->currently_disabled_keys;
134 share->currently_disabled_keys= 0;
156int heap_indexes_are_disabled(HP_INFO *info)
158 HP_SHARE *share= info->getShare();
160 return (! share->keys && share->currently_disabled_keys);
TODO: Rename this file - func.h is stupid.