summaryrefslogtreecommitdiff
path: root/storage/myisam/ft_boolean_search.c
diff options
context:
space:
mode:
Diffstat (limited to 'storage/myisam/ft_boolean_search.c')
-rw-r--r--storage/myisam/ft_boolean_search.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/storage/myisam/ft_boolean_search.c b/storage/myisam/ft_boolean_search.c
index 8b61e1dc4f2..b67f1ea6a25 100644
--- a/storage/myisam/ft_boolean_search.c
+++ b/storage/myisam/ft_boolean_search.c
@@ -1,4 +1,4 @@
-/* Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
+/* Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -197,7 +197,8 @@ static int ftb_query_add_word(MYSQL_FTPARSER_PARAM *param,
ftbw= (FTB_WORD *)alloc_root(&ftb_param->ftb->mem_root,
sizeof(FTB_WORD) +
(info->trunc ? HA_MAX_KEY_BUFF :
- word_len * ftb_param->ftb->charset->mbmaxlen +
+ (word_len + 1) *
+ ftb_param->ftb->charset->mbmaxlen +
HA_FT_WLEN +
ftb_param->ftb->info->s->rec_reflength));
ftbw->len= word_len + 1;