mariadb/storage/innobase
Marko Mäkelä 732672c304 MDEV-11233 CREATE FULLTEXT INDEX with a token longer than 127 bytes
crashes server

This bug is the result of merging the Oracle MySQL follow-up fix
BUG#22963169 MYSQL CRASHES ON CREATE FULLTEXT INDEX
without merging the base bug fix:
Bug#79475 Insert a token of 84 4-bytes chars into fts index causes
server crash.

Unlike the above mentioned fixes in MySQL, our fix will not change
the storage format of fulltext indexes in InnoDB or XtraDB
when a character encoding with mbmaxlen=2 or mbmaxlen=3
and the length of a word is between 128 and 84*mbmaxlen bytes.
The Oracle fix would allocate 2 length bytes for these cases.

Compatibility with other MySQL and MariaDB releases is ensured by
persisting the used maximum length in the SYS_COLUMNS table in the
InnoDB data dictionary.

This fix also removes some unnecessary strcmp() calls when checking
for the legacy default collation my_charset_latin1
(my_charset_latin1.name=="latin1_swedish_ci").

fts_create_one_index_table(): Store the actual length in bytes.
This metadata will be written to the SYS_COLUMNS table.

fts_zip_initialize(): Initialize only the first byte of the buffer.
Actually the code should not even care about this first byte, because
the length is set as 0.

FTX_MAX_WORD_LEN: Define as HA_FT_MAXCHARLEN * 4 aka 336 bytes,
not as 254 bytes.

row_merge_create_fts_sort_index(): Set the actual maximum length of the
column in bytes, similar to fts_create_one_index_table().

row_merge_fts_doc_tokenize(): Remove the redundant parameter word_dtype.
Use the actual maximum length of the column. Calculate the extra_size
in the same way as row_merge_buf_encode() does.
2017-01-27 10:19:39 +02:00
..
api Merge branch 'merge-innodb-5.6' into 10.0 2015-08-03 16:23:58 +02:00
btr Merge branch 'merge-innodb-5.6' into 10.0 2016-06-21 14:58:19 +02:00
buf MDEV-10469: innodb.innodb-alter-tempfile fails in buildbot: InnoDB: Warning: database page corruption or a failed 2016-08-13 09:27:50 +03:00
data 5.6.31 2016-06-21 14:21:03 +02:00
dict Merge remote-tracking branch 'merge/merge-innodb-5.6' into 10.0 2017-01-10 12:20:38 +02:00
dyn move to storage/innobase 2015-05-04 19:17:21 +02:00
eval move to storage/innobase 2015-05-04 19:17:21 +02:00
fil Add more diagnostic to find out the problem on 2016-07-04 17:38:47 +03:00
fsp Merge branch 'merge-innodb-5.6' into 10.0 2016-06-21 14:58:19 +02:00
fts MDEV-11233 CREATE FULLTEXT INDEX with a token longer than 127 bytes 2017-01-27 10:19:39 +02:00
fut move to storage/innobase 2015-05-04 19:17:21 +02:00
ha move to storage/innobase 2015-05-04 19:17:21 +02:00
handler MDEV-11233 CREATE FULLTEXT INDEX with a token longer than 127 bytes 2017-01-27 10:19:39 +02:00
ibuf Merge branch 'merge-innodb-5.6' into 10.0 2016-06-21 14:58:19 +02:00
include MDEV-11233 CREATE FULLTEXT INDEX with a token longer than 127 bytes 2017-01-27 10:19:39 +02:00
lock Merge branch 'merge-innodb-5.6' into 10.0 2016-06-21 14:58:19 +02:00
log MDEV-11915 Detect InnoDB system tablespace size mismatch early 2017-01-26 23:10:36 +02:00
mach 5.6.35 2017-01-07 14:24:42 +02:00
mem 5.6.31 2016-06-21 14:21:03 +02:00
mtr 5.6.31 2016-06-21 14:21:03 +02:00
mysql-test/storage_engine 5.5 merge 2014-11-19 17:23:39 +01:00
os Merge remote-tracking branch 'merge/merge-innodb-5.6' into 10.0 2017-01-10 12:20:38 +02:00
page Merge branch '5.5' into 10.0 2016-08-10 19:19:05 +02:00
pars 5.6.31 2016-06-21 14:21:03 +02:00
que 5.6.24 2015-05-04 22:13:46 +02:00
read move to storage/innobase 2015-05-04 19:17:21 +02:00
rem 5.6.31 2016-06-21 14:21:03 +02:00
row MDEV-11233 CREATE FULLTEXT INDEX with a token longer than 127 bytes 2017-01-27 10:19:39 +02:00
srv MDEV-11915 Detect InnoDB system tablespace size mismatch early 2017-01-26 23:10:36 +02:00
sync Merge branch 'merge-innodb-5.6' into 10.0 2016-06-21 14:58:19 +02:00
trx Merge following commit from 5.5: 2016-06-23 07:42:40 +03:00
usr move to storage/innobase 2015-05-04 19:17:21 +02:00
ut MDEV-9276: MySQL Bug #78754: FK definitions missing from SHOW CREATE TABLE in "innodb_read_only" mode 2015-12-14 22:10:37 +02:00
CMakeLists.txt MDEV-8883 more cross-compiling fixes 2015-10-24 19:58:34 +02:00
compile-innodb move to storage/innobase 2015-05-04 19:17:21 +02:00
COPYING.Google move to storage/innobase 2015-05-04 19:17:21 +02:00
COPYING.Percona move to storage/innobase 2015-05-04 19:17:21 +02:00
Doxyfile move to storage/innobase 2015-05-04 19:17:21 +02:00
ha_innodb.def move to storage/innobase 2015-05-04 19:17:21 +02:00
plugin_exports Solaris compilation failure: xtradb is linked in statically, ha_innodb.so needs 2014-05-01 14:05:52 +02:00