~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_keycache.c

  • Committer: Monty Taylor
  • Date: 2008-07-01 14:33:36 UTC
  • mto: (28.1.12 backport_patch)
  • mto: This revision was merged to the branch mainline in revision 34.
  • Revision ID: monty@inaugust.com-20080701143336-8uihm7dhpu92rt0q
Somehow missed moving password.c. Duh.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
*/
48
48
 
49
49
int mi_assign_to_key_cache(MI_INFO *info,
50
 
                           uint64_t key_map __attribute__((unused)),
 
50
                           ulonglong key_map __attribute__((unused)),
51
51
                           KEY_CACHE *key_cache)
52
52
{
53
53
  int error= 0;
54
54
  MYISAM_SHARE* share= info->s;
 
55
  DBUG_ENTER("mi_assign_to_key_cache");
 
56
  DBUG_PRINT("enter",("old_key_cache_handle: 0x%lx  new_key_cache_handle: 0x%lx",
 
57
                      (long) share->key_cache, (long) key_cache));
55
58
 
56
59
  /*
57
60
    Skip operation if we didn't change key cache. This can happen if we
58
61
    call this for all open instances of the same table
59
62
  */
60
63
  if (share->key_cache == key_cache)
61
 
    return(0);
 
64
    DBUG_RETURN(0);
62
65
 
63
66
  /*
64
67
    First flush all blocks for the table in the old key cache.
101
104
  share->key_cache= key_cache;
102
105
 
103
106
  /* store the key cache in the global hash structure for future opens */
104
 
  if (multi_key_cache_set((unsigned char*) share->unique_file_name,
 
107
  if (multi_key_cache_set((uchar*) share->unique_file_name,
105
108
                          share->unique_name_length,
106
109
                          share->key_cache))
107
110
    error= my_errno;
108
111
  pthread_mutex_unlock(&share->intern_lock);
109
 
  return(error);
 
112
  DBUG_RETURN(error);
110
113
}
111
114
 
112
115
 
135
138
                         KEY_CACHE *new_key_cache)
136
139
{
137
140
  LIST *pos;
 
141
  DBUG_ENTER("mi_change_key_cache");
138
142
 
139
143
  /*
140
144
    Lock list to ensure that no one can close the table while we manipulate it
145
149
    MI_INFO *info= (MI_INFO*) pos->data;
146
150
    MYISAM_SHARE *share= info->s;
147
151
    if (share->key_cache == old_key_cache)
148
 
      mi_assign_to_key_cache(info, UINT64_MAX, new_key_cache);
 
152
      mi_assign_to_key_cache(info, (ulonglong) ~0, new_key_cache);
149
153
  }
150
154
 
151
155
  /*
155
159
  */
156
160
  multi_key_cache_change(old_key_cache, new_key_cache);
157
161
  pthread_mutex_unlock(&THR_LOCK_myisam);
158
 
  return;
 
162
  DBUG_VOID_RETURN;
159
163
}