From 4b5dc47f569f766287bd8f4801ab6b865868d01a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 6 Mar 2019 12:45:54 +0200 Subject: [PATCH] MDEV-18659: Revert a non-functional change fts_fetch_index_words(): Restore the initialization len=0. The test innodb_fts.create in 10.2 would end up in an infinite loop if this assignment is removed, because a following iteration of the while() loop would assign zip->zp->avail_in=len with the original value instead of the 0 that was reset in the previous iteration. --- storage/innobase/fts/fts0opt.cc | 4 ++-- storage/xtradb/fts/fts0opt.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/storage/innobase/fts/fts0opt.cc b/storage/innobase/fts/fts0opt.cc index 4ef83aefef6..28e704eb9a5 100644 --- a/storage/innobase/fts/fts0opt.cc +++ b/storage/innobase/fts/fts0opt.cc @@ -717,15 +717,15 @@ fts_fetch_index_words( zip->zp->next_in = static_cast(data); zip->zp->avail_in = len; ut_a(len <= FTS_MAX_WORD_LEN); + len = 0; } - break; + continue; case Z_STREAM_END: case Z_BUF_ERROR: case Z_STREAM_ERROR: default: ut_error; - break; } } diff --git a/storage/xtradb/fts/fts0opt.cc b/storage/xtradb/fts/fts0opt.cc index 4ef83aefef6..28e704eb9a5 100644 --- a/storage/xtradb/fts/fts0opt.cc +++ b/storage/xtradb/fts/fts0opt.cc @@ -717,15 +717,15 @@ fts_fetch_index_words( zip->zp->next_in = static_cast(data); zip->zp->avail_in = len; ut_a(len <= FTS_MAX_WORD_LEN); + len = 0; } - break; + continue; case Z_STREAM_END: case Z_BUF_ERROR: case Z_STREAM_ERROR: default: ut_error; - break; } }