summaryrefslogtreecommitdiff
path: root/myisam
diff options
context:
space:
mode:
authorunknown <kaa@polly.(none)>2007-10-16 19:20:00 +0400
committerunknown <kaa@polly.(none)>2007-10-16 19:20:00 +0400
commit9ef7b5f6f0a71208892ad97c89f5e6aba173b5a3 (patch)
tree4fc28944e0debe5dbd0863c4a795e6a01cd4896e /myisam
parent13afffd03b80ab73d813158f3d0a1ebf63a5ef31 (diff)
parent99a7866a93823dad2e22ae9125bc57fa9643e838 (diff)
downloadmariadb-git-9ef7b5f6f0a71208892ad97c89f5e6aba173b5a3.tar.gz
Merge polly.(none):/home/kaa/src/maint/mysql-4.1-maint
into polly.(none):/home/kaa/src/maint/mysql-5.0-maint myisam/sort.c: Auto merged mysql-test/r/repair.result: Auto merged mysql-test/t/repair.test: Auto merged
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);