diff options
author | unknown <monty@mashka.mysql.fi> | 2002-11-18 16:21:53 +0200 |
---|---|---|
committer | unknown <monty@mashka.mysql.fi> | 2002-11-18 16:21:53 +0200 |
commit | b34d11f891ce9fbdc8120cdbed47d500dce94d24 (patch) | |
tree | 99419c96d1c2e6eda2f6a0c28e3ebfbe04e89081 | |
parent | 2ef5ec316c2e7a34c6db6060f4869f0fd7026e03 (diff) | |
parent | e41123b89fbf0bb0590c1736f7ad2f9bbb2c47c4 (diff) | |
download | mariadb-git-b34d11f891ce9fbdc8120cdbed47d500dce94d24.tar.gz |
Merge work:/home/bk/mysql into mashka.mysql.fi:/home/my/mysql-3.23
-rw-r--r-- | mysys/mf_keycache.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c index 5b8ec96b4d1..d5b0a0a056a 100644 --- a/mysys/mf_keycache.c +++ b/mysys/mf_keycache.c @@ -548,13 +548,14 @@ int flush_key_blocks(File file, enum flush_type type) count++; } /* Only allocate a new buffer if its bigger than the one we have */ - if (count <= FLUSH_CACHE || - !(cache=(SEC_LINK**) my_malloc(sizeof(SEC_LINK*)*count,MYF(0)))) + if (count > FLUSH_CACHE) { - cache=cache_buff; /* Fall back to safe buffer */ - count=FLUSH_CACHE; + if (!(cache=(SEC_LINK**) my_malloc(sizeof(SEC_LINK*)*count,MYF(0)))) + { + cache=cache_buff; /* Fall back to safe buffer */ + count=FLUSH_CACHE; + } } - end=cache+count; } /* Go through the keys and write them to buffer to be flushed */ |