~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/heap/hp_clear.cc

  • Committer: Stewart Smith
  • Date: 2010-06-16 14:17:58 UTC
  • mto: (1626.1.3 build)
  • mto: This revision was merged to the branch mainline in revision 1633.
  • Revision ID: stewart@flamingspork.com-20100616141758-odpf36m0wo09ok4c
add handler_write status variable test for when statement was rolled back

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
/*
17
17
  remove all records from database
27
27
 
28
28
void heap_clear(HP_INFO *info)
29
29
{
30
 
  hp_clear(info->getShare());
 
30
  hp_clear(info->s);
31
31
}
32
32
 
33
33
void hp_clear(HP_SHARE *info)
56
56
 
57
57
static void hp_clear_keys(HP_SHARE *info)
58
58
{
59
 
  for (uint32_t key=0 ; key < info->keys ; key++)
 
59
  uint32_t key;
 
60
 
 
61
  for (key=0 ; key < info->keys ; key++)
60
62
  {
61
63
    HP_KEYDEF *keyinfo = info->keydef + key;
 
64
    if (keyinfo->algorithm == HA_KEY_ALG_BTREE)
 
65
    {
 
66
      delete_tree(&keyinfo->rb_tree);
 
67
    }
 
68
    else
62
69
    {
63
70
      HP_BLOCK *block= &keyinfo->block;
64
71
      if (block->levels)
69
76
    }
70
77
  }
71
78
  info->index_length=0;
 
79
  return;
72
80
}
73
81
 
74
82
 
88
96
 
89
97
int heap_disable_indexes(HP_INFO *info)
90
98
{
91
 
  HP_SHARE *share= info->getShare();
 
99
  HP_SHARE *share= info->s;
92
100
 
93
101
  if (share->keys)
94
102
  {
122
130
int heap_enable_indexes(HP_INFO *info)
123
131
{
124
132
  int error= 0;
125
 
  HP_SHARE *share= info->getShare();
 
133
  HP_SHARE *share= info->s;
126
134
 
127
135
  if (share->recordspace.total_data_length || share->index_length)
128
136
    error= HA_ERR_CRASHED;
154
162
 
155
163
int heap_indexes_are_disabled(HP_INFO *info)
156
164
{
157
 
  HP_SHARE *share= info->getShare();
 
165
  HP_SHARE *share= info->s;
158
166
 
159
167
  return (! share->keys && share->currently_disabled_keys);
160
168
}