Skip to content

Commit 66cc755

Browse files
author
Andrzej Jarzabek
committed
Bug#34929814 Double processing of FTS index words with innodb_optimize_fulltext_only
Symptom: When running OPTIMIZE TABLE on a table with FTS index with innodb_optimize_fulltext_only option enabled, the last word to be processed is very rarely and apparently randomly processed twice. Root cause: When zlib uncompressed the end of a compressed stream, inflate() will either return Z_STREAM_END, or it will return Z_OK, in which case the subsequent call will output 0 bytes and return Z_STREAM_END. fts_zip_read_word function handles the first case correctly, but in the second the behavior is incorrect: on the call, where Z_STREAM_END is returned from inflate(), fts_zip_read_word returns true without actually touching the word buffer. When this happens, the caller interprets this as the function having read the same word as it read on the previous call, and processes that word again. Fix: Change the logic of the function to return false if inflate() returns Z_STREAM_END without reading any bytes. refactor to make explicit the various states when reading a word from the compressed stream. Change-Id: Ib777a03b5dac0fc8bda2022b0342177f1c7d2e4a
1 parent 13d292e commit 66cc755

File tree

4 files changed

+7454
-35
lines changed

4 files changed

+7454
-35
lines changed

0 commit comments

Comments
 (0)