~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to storage/myisam/mf_keycaches.c

  • Committer: Brian Aker
  • Date: 2008-10-06 06:47:29 UTC
  • Revision ID: brian@tangent.org-20081006064729-2i9mhjkzyvow9xsm
RemoveĀ uint.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
typedef struct st_safe_hash_entry
48
48
{
49
49
  unsigned char *key;
50
 
  uint length;
 
50
  uint32_t length;
51
51
  unsigned char *data;
52
52
  struct st_safe_hash_entry *next, **prev;
53
53
} SAFE_HASH_ENTRY;
103
103
    1  error
104
104
*/
105
105
 
106
 
static bool safe_hash_init(SAFE_HASH *hash, uint elements,
 
106
static bool safe_hash_init(SAFE_HASH *hash, uint32_t elements,
107
107
                              unsigned char *default_value)
108
108
{
109
109
  if (hash_init(&hash->hash, &my_charset_bin, elements,
145
145
  Return the value stored for a key or default value if no key
146
146
*/
147
147
 
148
 
static unsigned char *safe_hash_search(SAFE_HASH *hash, const unsigned char *key, uint length)
 
148
static unsigned char *safe_hash_search(SAFE_HASH *hash, const unsigned char *key, uint32_t length)
149
149
{
150
150
  unsigned char *result;
151
151
  rw_rdlock(&hash->mutex);
179
179
    1  error (Can only be EOM). In this case my_message() is called.
180
180
*/
181
181
 
182
 
static bool safe_hash_set(SAFE_HASH *hash, const unsigned char *key, uint length,
 
182
static bool safe_hash_set(SAFE_HASH *hash, const unsigned char *key, uint32_t length,
183
183
                             unsigned char *data)
184
184
{
185
185
  SAFE_HASH_ENTRY *entry;
307
307
  SYNOPSIS
308
308
    multi_key_cache_search()
309
309
    key                         key to find (usually table path)
310
 
    uint length                 Length of key.
 
310
    uint32_t length                     Length of key.
311
311
 
312
312
  NOTES
313
313
    This function is coded in such a way that we will return the
318
318
    key cache to use
319
319
*/
320
320
 
321
 
KEY_CACHE *multi_key_cache_search(unsigned char *key, uint length)
 
321
KEY_CACHE *multi_key_cache_search(unsigned char *key, uint32_t length)
322
322
{
323
323
  if (!key_cache_hash.hash.records)
324
324
    return dflt_key_cache;
342
342
*/
343
343
 
344
344
 
345
 
bool multi_key_cache_set(const unsigned char *key, uint length,
 
345
bool multi_key_cache_set(const unsigned char *key, uint32_t length,
346
346
                            KEY_CACHE *key_cache)
347
347
{
348
348
  return safe_hash_set(&key_cache_hash, key, length, (unsigned char*) key_cache);