diff --git a/storage/innobase/include/row0merge.h b/storage/innobase/include/row0merge.h index fa00700b225bf..196543f25e194 100644 --- a/storage/innobase/include/row0merge.h +++ b/storage/innobase/include/row0merge.h @@ -41,6 +41,9 @@ Created 13/06/2005 Jan Lindstrom #include "lock0types.h" #include "srv0srv.h" +/* Reserve free space from every block for key_version */ +#define ROW_MERGE_RESERVE_SIZE 4 + /* Cluster index read task is mandatory */ #define COST_READ_CLUSTERED_INDEX 1.0 diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc index f970938f72961..4c021973b9a12 100644 --- a/storage/innobase/row/row0ftsort.cc +++ b/storage/innobase/row/row0ftsort.cc @@ -557,9 +557,11 @@ row_merge_fts_doc_tokenize( fts_max_token_size, add one extra size and one extra byte */ cur_len += 2; - /* Reserve one byte for the end marker of row_merge_block_t. */ + /* Reserve one byte for the end marker of row_merge_block_t + and we have reserved ROW_MERGE_RESERVE_SIZE (= 4) for + encryption key_version in the beginning of the buffer. */ if (buf->total_size + data_size[idx] + cur_len - >= srv_sort_buf_size - 1) { + >= (srv_sort_buf_size - 1 - ROW_MERGE_RESERVE_SIZE)) { buf_full = TRUE; break; diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index c921c5b7318e6..f5cc33fb57d4a 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -78,8 +78,6 @@ UNIV_INTERN char srv_disable_sort_file_cache; /* Maximum pending doc memory limit in bytes for a fts tokenization thread */ #define FTS_PENDING_DOC_MEMORY_LIMIT 1000000 -/* Reserve free space from every block for key_version */ -#define ROW_MERGE_RESERVE_SIZE 4 /******************************************************//** Encrypt a merge block. */ @@ -2571,7 +2569,11 @@ row_merge_sort( of file marker). Thus, it must be at least one block. */ ut_ad(file->offset > 0); - thd_progress_init(trx->mysql_thd, num_runs); + /* Progress report only for "normal" indexes. */ + if (!(dup->index->type & DICT_FTS)) { + thd_progress_init(trx->mysql_thd, num_runs); + } + sql_print_information("InnoDB: Online DDL : merge-sorting has estimated %lu runs", num_runs); /* Merge the runs until we have one big run */ @@ -2580,7 +2582,10 @@ row_merge_sort( /* Report progress of merge sort to MySQL for show processlist progress field */ - thd_progress_report(trx->mysql_thd, cur_run, num_runs); + /* Progress report only for "normal" indexes. */ + if (!(dup->index->type & DICT_FTS)) { + thd_progress_report(trx->mysql_thd, cur_run, num_runs); + } sql_print_information("InnoDB: Online DDL : merge-sorting current run %lu estimated %lu runs", cur_run, num_runs); error = row_merge(trx, dup, file, block, tmpfd, @@ -2605,7 +2610,10 @@ row_merge_sort( mem_free(run_offset); - thd_progress_end(trx->mysql_thd); + /* Progress report only for "normal" indexes. */ + if (!(dup->index->type & DICT_FTS)) { + thd_progress_end(trx->mysql_thd); + } DBUG_RETURN(error); } diff --git a/storage/xtradb/include/row0merge.h b/storage/xtradb/include/row0merge.h index fa00700b225bf..196543f25e194 100644 --- a/storage/xtradb/include/row0merge.h +++ b/storage/xtradb/include/row0merge.h @@ -41,6 +41,9 @@ Created 13/06/2005 Jan Lindstrom #include "lock0types.h" #include "srv0srv.h" +/* Reserve free space from every block for key_version */ +#define ROW_MERGE_RESERVE_SIZE 4 + /* Cluster index read task is mandatory */ #define COST_READ_CLUSTERED_INDEX 1.0 diff --git a/storage/xtradb/row/row0ftsort.cc b/storage/xtradb/row/row0ftsort.cc index 55ac0a7d42343..c7a5b51ef5541 100644 --- a/storage/xtradb/row/row0ftsort.cc +++ b/storage/xtradb/row/row0ftsort.cc @@ -560,9 +560,11 @@ row_merge_fts_doc_tokenize( fts_max_token_size, add one extra size and one extra byte */ cur_len += 2; - /* Reserve one byte for the end marker of row_merge_block_t. */ + /* Reserve one byte for the end marker of row_merge_block_t + and we have reserved ROW_MERGE_RESERVE_SIZE (= 4) for + encryption key_version in the beginning of the buffer. */ if (buf->total_size + data_size[idx] + cur_len - >= srv_sort_buf_size - 1) { + >= (srv_sort_buf_size - 1 - ROW_MERGE_RESERVE_SIZE)) { buf_full = TRUE; break; diff --git a/storage/xtradb/row/row0merge.cc b/storage/xtradb/row/row0merge.cc index 3ac18eb95d9cc..8e0ed3780ae07 100644 --- a/storage/xtradb/row/row0merge.cc +++ b/storage/xtradb/row/row0merge.cc @@ -78,8 +78,6 @@ UNIV_INTERN char srv_disable_sort_file_cache; /* Maximum pending doc memory limit in bytes for a fts tokenization thread */ #define FTS_PENDING_DOC_MEMORY_LIMIT 1000000 -/* Reserve free space from every block for key_version */ -#define ROW_MERGE_RESERVE_SIZE 4 /******************************************************//** Encrypt a merge block. */ @@ -2578,7 +2576,11 @@ row_merge_sort( of file marker). Thus, it must be at least one block. */ ut_ad(file->offset > 0); - thd_progress_init(trx->mysql_thd, num_runs); + /* Progress report only for "normal" indexes. */ + if (!(dup->index->type & DICT_FTS)) { + thd_progress_init(trx->mysql_thd, num_runs); + } + sql_print_information("InnoDB: Online DDL : merge-sorting has estimated %lu runs", num_runs); /* Merge the runs until we have one big run */ @@ -2587,7 +2589,10 @@ row_merge_sort( /* Report progress of merge sort to MySQL for show processlist progress field */ - thd_progress_report(trx->mysql_thd, cur_run, num_runs); + /* Progress report only for "normal" indexes. */ + if (!(dup->index->type & DICT_FTS)) { + thd_progress_report(trx->mysql_thd, cur_run, num_runs); + } sql_print_information("InnoDB: Online DDL : merge-sorting current run %lu estimated %lu runs", cur_run, num_runs); error = row_merge(trx, dup, file, block, tmpfd, @@ -2612,7 +2617,10 @@ row_merge_sort( mem_free(run_offset); - thd_progress_end(trx->mysql_thd); + /* Progress report only for "normal" indexes. */ + if (!(dup->index->type & DICT_FTS)) { + thd_progress_end(trx->mysql_thd); + } DBUG_RETURN(error); }