summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authorkaa@polly.(none) <>2007-10-16 19:20:00 +0400
committerkaa@polly.(none) <>2007-10-16 19:20:00 +0400
commit5cb0d70646a589303a7b3b1f769ed6d43c3c62cd (patch)
tree4fc28944e0debe5dbd0863c4a795e6a01cd4896e /myisam
parentcecc37d8b469165f6aa49f0d642e91de4661e2f3 (diff)
parent18250925bcad309e8dd5424ba40205be60cdbf59 (diff)
downloadmariadb-git-5cb0d70646a589303a7b3b1f769ed6d43c3c62cd.tar.gz
Merge polly.(none):/home/kaa/src/maint/mysql-4.1-maint
into polly.(none):/home/kaa/src/maint/mysql-5.0-maint
Diffstat (limited to 'myisam')
-rw-r--r--myisam/sort.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/myisam/sort.c b/myisam/sort.c
index f48161b7c8e..a3fab5025a8 100644
--- a/myisam/sort.c
+++ b/myisam/sort.c
@@ -565,9 +565,10 @@ int thr_write_keys(MI_SORT_PARAM *sort_param)
if (!mergebuf)
{
length=param->sort_buffer_length;
- while (length >= MIN_SORT_MEMORY && !mergebuf)
+ while (length >= MIN_SORT_MEMORY)
{
- mergebuf=my_malloc(length, MYF(0));
+ if ((mergebuf= my_malloc(length, MYF(0))))
+ break;
length=length*3/4;
}
if (!mergebuf)
@@ -905,6 +906,7 @@ merge_buffers(MI_SORT_PARAM *info, uint keys, IO_CACHE *from_file,
count=error=0;
maxcount=keys/((uint) (Tb-Fb) +1);
+ DBUG_ASSERT(maxcount > 0);
LINT_INIT(to_start_filepos);
if (to_file)
to_start_filepos=my_b_tell(to_file);