~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_keycache.cc

  • Committer: Padraig O'Sullivan
  • Date: 2009-03-28 06:01:24 UTC
  • mto: (968.2.5 mordred)
  • mto: This revision was merged to the branch mainline in revision 971.
  • Revision ID: osullivan.padraig@gmail.com-20090328060124-fdjygihvmr0kpf58
Reverting some refactoring changes I made to MyISAM that didn't really work
out.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
 
20
20
#include "myisamdef.h"
21
21
 
22
 
using namespace std;
23
 
 
24
22
/*
25
23
  Assign pages of the index file for a table to a key cache
26
24
 
136
134
void mi_change_key_cache(KEY_CACHE *old_key_cache,
137
135
                         KEY_CACHE *new_key_cache)
138
136
{
 
137
  LIST *pos;
 
138
 
139
139
  /*
140
140
    Lock list to ensure that no one can close the table while we manipulate it
141
141
  */
142
142
  pthread_mutex_lock(&THR_LOCK_myisam);
143
 
  list<MI_INFO *>::iterator it= myisam_open_list.begin();
144
 
  while (it != myisam_open_list.end())
 
143
  for (pos=myisam_open_list ; pos ; pos=pos->next)
145
144
  {
146
 
    MI_INFO *info= *it;
 
145
    MI_INFO *info= (MI_INFO*) pos->data;
147
146
    MYISAM_SHARE *share= info->s;
148
147
    if (share->key_cache == old_key_cache)
149
148
      mi_assign_to_key_cache(info, UINT64_MAX, new_key_cache);
150
 
    ++it;
151
149
  }
152
150
 
153
151
  /*