summaryrefslogtreecommitdiff
path: root/myisam/sort.c
diff options
context:
space:
mode:
authorsvoj@mysql.com <>2005-08-02 11:33:26 +0500
committersvoj@mysql.com <>2005-08-02 11:33:26 +0500
commit19fe33e16ca3fe23e3df42a9d388e8f649446dbe (patch)
treed35146d5534ba1ad93f78c35387181ac248a257b /myisam/sort.c
parent4098c40d87ac11fe5043061f16a95a455376a782 (diff)
downloadmariadb-git-19fe33e16ca3fe23e3df42a9d388e8f649446dbe.tar.gz
BUG#11684 fix.
Repair crashes mysql when table has fulltext index.
Diffstat (limited to 'myisam/sort.c')
-rw-r--r--myisam/sort.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/myisam/sort.c b/myisam/sort.c
index 95ede6ddaa1..45a670c3f6b 100644
--- a/myisam/sort.c
+++ b/myisam/sort.c
@@ -532,13 +532,15 @@ int thr_write_keys(MI_SORT_PARAM *sort_param)
while (!got_error &&
!my_b_read(&sinfo->tempfile_for_exceptions,(byte*)&key_length,
- sizeof(key_length)) &&
- !my_b_read(&sinfo->tempfile_for_exceptions,(byte*)mergebuf,
- (uint) key_length))
+ sizeof(key_length)))
{
- if (_mi_ck_write(info,sinfo->key,(uchar*) mergebuf,
- key_length - info->s->rec_reflength))
- got_error=1;
+ byte ft_buf[HA_FT_MAXLEN + HA_FT_WLEN + 10];
+ if (key_length > sizeof(ft_buf) ||
+ my_b_read(&sinfo->tempfile_for_exceptions, (byte*)ft_buf,
+ (uint)key_length) ||
+ _mi_ck_write(info, sinfo->key, (uchar*)ft_buf,
+ key_length - info->s->rec_reflength))
+ got_error=1;
}
}
}