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
commit33d678fcdc2d0b431c0f08e11e0b6715cd37cda0 (patch)
treee3b0f252f2776f41e8db495a24048a795b9019f4 /mysys/mf_keycache.c
parent54c03ff73630ce782d3c982003989b12a3fa5728 (diff)
parent7bc917e9e12c4be30628a09a56f75c6e0a669802 (diff)
downloadmariadb-git-33d678fcdc2d0b431c0f08e11e0b6715cd37cda0.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 */