summaryrefslogtreecommitdiff
path: root/mysys
diff options
context:
space:
mode:
authormonty@mashka.mysql.fi <>2002-11-19 12:35:17 +0200
committermonty@mashka.mysql.fi <>2002-11-19 12:35:17 +0200
commitf9e6ae6f42bb4321639ec40c622c394d79d17661 (patch)
treee3b0f252f2776f41e8db495a24048a795b9019f4 /mysys
parentc9c7e4d503ee1fe03ebfe5f68f4d9d2d101c3bbe (diff)
parent9cc2b10bdf55027e24d95ad2aeec365d7d3d6952 (diff)
downloadmariadb-git-f9e6ae6f42bb4321639ec40c622c394d79d17661.tar.gz
merge with 3.23
Diffstat (limited to 'mysys')
-rw-r--r--mysys/Makefile.am2
-rw-r--r--mysys/mf_keycache.c11
2 files changed, 7 insertions, 6 deletions
diff --git a/mysys/Makefile.am b/mysys/Makefile.am
index 9fea00e23e8..6047debcaf5 100644
--- a/mysys/Makefile.am
+++ b/mysys/Makefile.am
@@ -100,7 +100,7 @@ test_io_cache: mf_iocache.c $(LIBRARIES)
test_dir: test_dir.c $(LIBRARIES)
$(LINK) $(FLAGS) -DMAIN $(srcdir)/test_dir.c $(LDADD) $(LIBS)
-test_charset: test_charset.c $(LIBRARIES)
+test_charset$(EXEEXT): test_charset.c $(LIBRARIES)
$(LINK) $(FLAGS) -DMAIN $(srcdir)/test_charset.c $(LDADD) $(LIBS)
testhash: testhash.c $(LIBRARIES)
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 */