32 DBUG_ENTER(
"hp_clear");
34 if (info->block.levels)
35 (void) hp_free_level(&info->block,info->block.levels,info->block.root,
39 info->records= info->deleted= 0;
62 void heap_clear_keys(
HP_INFO *info)
85 DBUG_ENTER(
"hp_clear_keys");
87 for (key=0 ; key < info->keys ; key++)
90 if (keyinfo->algorithm == HA_KEY_ALG_BTREE)
92 delete_tree(&keyinfo->rb_tree);
98 (void) hp_free_level(block,block->levels,block->root,(uchar*) 0);
100 block->last_allocated=0;
101 keyinfo->hash_buckets= 0;
104 info->index_length=0;
123 int heap_disable_indexes(
HP_INFO *info)
129 hp_clear_keys(share);
130 share->currently_disabled_keys= share->keys;
156 int heap_enable_indexes(
HP_INFO *info)
161 if (share->data_length || share->index_length)
162 error= HA_ERR_CRASHED;
164 if (share->currently_disabled_keys)
166 share->keys= share->currently_disabled_keys;
167 share->currently_disabled_keys= 0;
189 int heap_indexes_are_disabled(
HP_INFO *info)
193 return (! share->keys && share->currently_disabled_keys);