diff options
Diffstat (limited to 'storage/innobase/row/row0ftsort.cc')
-rw-r--r-- | storage/innobase/row/row0ftsort.cc | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc index 9e340f24213..bdd0e63c0a6 100644 --- a/storage/innobase/row/row0ftsort.cc +++ b/storage/innobase/row/row0ftsort.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2010, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2010, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2015, 2016, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under @@ -557,8 +557,18 @@ row_merge_fts_doc_tokenize( dfield_dup(field, buf->heap); /* One variable length column, word with its lenght less than - fts_max_token_size, add one extra size and one extra byte */ - cur_len += 2; + fts_max_token_size, add one extra size and one extra byte. + + Since the max length for FTS token now is larger than 255, + so we will need to signify length byte itself, so only 1 to 128 + bytes can be used for 1 bytes, larger than that 2 bytes. */ + if (t_str.f_len < 128) { + /* Extra size is one byte. */ + cur_len += 2; + } else { + /* Extra size is two bytes. */ + cur_len += 3; + } /* Reserve one byte for the end marker of row_merge_block_t and we have reserved ROW_MERGE_RESERVE_SIZE (= 4) for @@ -1042,7 +1052,7 @@ row_fts_start_parallel_merge( /********************************************************************//** Insert processed FTS data to auxillary index tables. @return DB_SUCCESS if insertion runs fine */ -static __attribute__((nonnull)) +static MY_ATTRIBUTE((nonnull)) dberr_t row_merge_write_fts_word( /*=====================*/ |