~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mi_keycache.c

  • Committer: Monty Taylor
  • Date: 2008-10-16 06:32:30 UTC
  • mto: (511.1.5 codestyle)
  • mto: This revision was merged to the branch mainline in revision 521.
  • Revision ID: monty@inaugust.com-20081016063230-4brxsra0qsmsg84q
Added -Wunused-macros.

Show diffs side-by-side

added added

removed removed

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