summaryrefslogtreecommitdiff
path: root/mysys/mf_keycache.c
diff options
context:
space:
mode:
authorunknown <monty@mashka.mysql.fi>2002-11-19 12:35:17 +0200
committerunknown <monty@mashka.mysql.fi>2002-11-19 12:35:17 +0200
commitcd47d76957c30049059e727e3689214ca14ea846 (patch)
treee3b0f252f2776f41e8db495a24048a795b9019f4 /mysys/mf_keycache.c
parentd8388f2257006cf0b7a0da3e9c70979f0be12506 (diff)
parent6bd9e86e2423b288aef893de6c1c803f3bc11257 (diff)
downloadmariadb-git-cd47d76957c30049059e727e3689214ca14ea846.tar.gz
merge with 3.23
BitKeeper/etc/ignore: auto-union BitKeeper/deleted/.del-depcomp: Delete: depcomp config.guess: Auto merged config.sub: Auto merged configure.in: Auto merged dbug/Makefile.am: Auto merged heap/Makefile.am: Auto merged install-sh: Auto merged isam/Makefile.am: Auto merged libmysql_r/Makefile.am: Auto merged ltconfig: Auto merged ltmain.sh: Auto merged missing: Auto merged myisam/Makefile.am: Auto merged mysys/Makefile.am: Auto merged mysys/mf_keycache.c: Auto merged regex/Makefile.am: Auto merged sql/Makefile.am: Auto merged strings/Makefile.am: Auto merged
Diffstat (limited to 'mysys/mf_keycache.c')
-rw-r--r--mysys/mf_keycache.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/mysys/mf_keycache.c b/mysys/mf_keycache.c
index 5a573bff0f7..6a037f13f05 100644
--- a/mysys/mf_keycache.c
+++ b/mysys/mf_keycache.c
@@ -595,13 +595,14 @@ static int flush_key_blocks_int(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 */