diff options
author | igor@rurik.mysql.com <> | 2003-08-02 02:43:18 -0700 |
---|---|---|
committer | igor@rurik.mysql.com <> | 2003-08-02 02:43:18 -0700 |
commit | 9306f55d8e62aca4e00dab3408a8395af85fb947 (patch) | |
tree | add5cbee3049a38799b03ee640b5ae06fbc34ef1 /myisam/mi_keycache.c | |
parent | f0ca5d545d801a5c1efdda878a5f85079c30f428 (diff) | |
download | mariadb-git-9306f55d8e62aca4e00dab3408a8395af85fb947.tar.gz |
Many files:
Added key cache assignment
mi_locking.c:
Added key cache assignment: correction
my_sys.h:
Added key cache variable structure
Diffstat (limited to 'myisam/mi_keycache.c')
-rw-r--r-- | myisam/mi_keycache.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/myisam/mi_keycache.c b/myisam/mi_keycache.c index 75a6819f598..1010aef9e1d 100644 --- a/myisam/mi_keycache.c +++ b/myisam/mi_keycache.c @@ -28,7 +28,7 @@ mi_assign_to_keycache() info open table map map of indexes to assign to the key cache - keycache_name name of of the key cache to assign index to + key_cache_ptr pointer to the key cache handle RETURN VALUE 0 if a success. error code - otherwise. @@ -39,9 +39,25 @@ of the table will be assigned to the specified key cache. */ -int mi_assign_to_keycache(MI_INFO *info, ulonglong key_map, - char *keycache_name) +int mi_assign_to_keycache(MI_INFO *info, ulonglong key_map, + KEY_CACHE_HANDLE *reg_keycache) { - return 0; + int error= 0; + MYISAM_SHARE* share= info->s; + + DBUG_ENTER("mi_assign_to_keycache"); + + share->reg_keycache= reg_keycache; + if (!(info->lock_type == F_WRLCK && share->w_locks)) + { + if (flush_key_blocks(*share->keycache, share->kfile, FLUSH_RELEASE)) + { + error=my_errno; + mi_mark_crashed(info); /* Mark that table must be checked */ + } + share->keycache= reg_keycache; + } + + DBUG_RETURN(error); } |