Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions mysql-test/suite/innodb/r/check_index.result
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,24 @@ Table_name Index_name Type Total_size Usage_rate Delete_rate Btr_depth
test.tmp_table GEN_CLUST_INDEX PRIMARY_INDEX 16384 0.008 0.000 1
test.tmp_table NULL TABLE_LEVEL 16384 0.008 NULL NULL
drop table tmp_table;
CREATE TABLE fts_test (
`id` bigint NOT NULL,
`k` bigint NOT NULL,
`k1` bigint NOT NULL,
`c` char(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`pad` char(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`tran_time` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`body` text COLLATE utf8mb4_general_ci,
PRIMARY KEY (`id`,`tran_time`),
FULLTEXT KEY `tran_time` (`tran_time`,`body`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
check index from fts_test;
Table_name Index_name Type Total_size Usage_rate Delete_rate Btr_depth
test.fts_test PRIMARY PRIMARY_INDEX 16384 0.008 0.000 1
test.fts_test NULL TABLE_LEVEL 16384 0.008 NULL NULL
Warnings:
Warning 1235 Fulltext index is unsupported for check index. It will be omitted from the results list
drop table fts_test;
drop procedure load_t;
drop table t;
drop table t1;
Expand Down
15 changes: 15 additions & 0 deletions mysql-test/suite/innodb/t/check_index.test
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,21 @@ create temporary table tmp_table(id int, c1 int);
check index from tmp_table;
drop table tmp_table;

CREATE TABLE fts_test (
`id` bigint NOT NULL,
`k` bigint NOT NULL,
`k1` bigint NOT NULL,
`c` char(120) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`pad` char(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`tran_time` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`body` text COLLATE utf8mb4_general_ci,
PRIMARY KEY (`id`,`tran_time`),
FULLTEXT KEY `tran_time` (`tran_time`,`body`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
#--warning 1235
check index from fts_test;

drop table fts_test;
drop procedure load_t;
drop table t;
drop table t1;
Expand Down
7 changes: 7 additions & 0 deletions storage/innobase/handler/ha_innodb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26496,6 +26496,13 @@ bool ha_innobase::check_index(THD *thd) { /*!< in: user thread handle */
index = index->next()) {
if (index->type & DICT_FTS) continue;

if (strcmp(index->name, FTS_DOC_ID_INDEX_NAME) == 0) {
push_warning(thd, Sql_condition::SL_WARNING, ER_NOT_SUPPORTED_YET,
"Fulltext index is unsupported for check index. It will be "
"omitted from the results list");
continue;
}

index_physical_info_t idx_info;
int btr_depth = 0;
if (innobase_get_index_status(index, m_prebuilt->table->space, &idx_info,
Expand Down