mariadb/storage/innobase
Marko Mäkelä cc85ba8f2e 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.
2016-12-05 16:32:03 +02:00
..
api MDEV-10813 - Clean-up InnoDB atomics, memory barriers and mutexes 2016-10-17 18:35:48 +04:00
btr MDEV-10813 - Clean-up InnoDB atomics, memory barriers and mutexes 2016-10-17 18:35:48 +04:00
buf MDEV-11349 (2/2) Fix some bogus-looking Valgrind warnings 2016-11-25 12:43:43 +02:00
data Merge InnoDB 5.7 from mysql-5.7.14. 2016-09-08 15:49:03 +03:00
dict fix build and some warnings 2016-11-24 17:36:02 +03:00
eval Merge InnoDB 5.7 from mysql-5.7.9. 2016-09-02 13:22:28 +03:00
fil MDEV-11426 Remove InnoDB INFORMATION_SCHEMA.FILES implementation 2016-12-01 13:16:25 +02:00
fsp Merge InnoDB 5.7 from mysql-5.7.14. 2016-09-08 15:49:03 +03:00
fts MDEV-11233 CREATE FULLTEXT INDEX with a token longer than 127 bytes 2016-12-05 16:32:03 +02:00
fut Merge InnoDB 5.7 from mysql-5.7.9. 2016-09-02 13:22:28 +03:00
gis Remove a bunch of TODO's, fix perfschema.threads_innodb test 2016-09-11 10:57:05 +02:00
ha Merge InnoDB 5.7 from mysql-5.7.9. 2016-09-02 13:22:28 +03:00
handler MDEV-11233 CREATE FULLTEXT INDEX with a token longer than 127 bytes 2016-12-05 16:32:03 +02:00
ibuf MDEV-10813 - Clean-up InnoDB atomics, memory barriers and mutexes 2016-10-17 18:35:48 +04:00
include MDEV-11233 CREATE FULLTEXT INDEX with a token longer than 127 bytes 2016-12-05 16:32:03 +02:00
lock MDEV-11168: InnoDB: Failing assertion: !other_lock || wsrep_thd_is_BF(lock->trx->mysql_thd, FALSE) || wsrep_thd_is_BF(other_lock->trx->mysql_thd, FALSE) 2016-12-02 17:28:39 +02:00
log MDEV-10813 - Clean-up InnoDB atomics, memory barriers and mutexes 2016-10-17 18:35:49 +04:00
mach Merge InnoDB 5.7 from mysql-5.7.9. 2016-09-02 13:22:28 +03:00
mem Merge InnoDB 5.7 from mysql-5.7.9. 2016-09-02 13:22:28 +03:00
mtr Merge InnoDB 5.7 from mysql-5.7.14. 2016-09-08 15:49:03 +03:00
mysql-test/storage_engine Follow-up for MDEV-6720 (enable connection log in mysqltest by default) 2016-06-19 20:30:03 +03:00
os MDEV-10813 - Clean-up InnoDB atomics, memory barriers and mutexes 2016-10-17 18:35:49 +04:00
page MDEV-10727: Merge 5.7 Innochecksum with 5.6 2016-09-30 08:08:19 +03:00
pars Merge InnoDB 5.7 from mysql-5.7.14. 2016-09-08 15:49:03 +03:00
que Merge InnoDB 5.7 from mysql-5.7.14. 2016-09-08 15:49:03 +03:00
read Merge InnoDB 5.7 from mysql-5.7.9. 2016-09-02 13:22:28 +03:00
rem Merge InnoDB 5.7 from mysql-5.7.14. 2016-09-08 15:49:03 +03:00
row MDEV-11233 CREATE FULLTEXT INDEX with a token longer than 127 bytes 2016-12-05 16:32:03 +02:00
srv MDEV-11250: mtflush threads stall on shutdown 2016-11-10 09:42:49 +02:00
sync MDEV-11296 - InnoDB stalls under OLTP RW on P8 2016-11-25 12:41:35 +04:00
trx MDEV-11236 Failing assertion: state == TRX_STATE_NOT_STARTED 2016-12-02 16:44:53 +02:00
usr Merge InnoDB 5.7 from mysql-5.7.9. 2016-09-02 13:22:28 +03:00
ut InnoDB cleanups 2016-11-15 14:56:29 +04:00
CMakeLists.txt MDEV-11195: Simplify enablement of NUMA in innodb/xtradb 2016-11-02 14:37:43 +11: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
innodb.cmake MDEV-10813 - Clean-up InnoDB atomics, memory barriers and mutexes 2016-10-17 18:35:49 +04:00
plugin_exports Solaris compilation failure: xtradb is linked in statically, ha_innodb.so needs 2014-05-01 14:05:52 +02:00