summaryrefslogtreecommitdiff
path: root/storage
diff options
context:
space:
mode:
Diffstat (limited to 'storage')
-rw-r--r--storage/innobase/handler/ha_innodb.cc11
-rw-r--r--storage/xtradb/handler/ha_innodb.cc11
2 files changed, 22 insertions, 0 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc
index e447af9bdad..f198a18656c 100644
--- a/storage/innobase/handler/ha_innodb.cc
+++ b/storage/innobase/handler/ha_innodb.cc
@@ -12599,6 +12599,17 @@ ha_innobase::defragment_table(
for (index = dict_table_get_first_index(table); index;
index = dict_table_get_next_index(index)) {
+ if (dict_index_is_corrupted(index)) {
+ continue;
+ }
+
+ if (index->page == FIL_NULL) {
+ /* Do not defragment auxiliary tables related
+ to FULLTEXT INDEX. */
+ ut_ad(index->type & DICT_FTS);
+ continue;
+ }
+
if (one_index && strcasecmp(index_name, index->name) != 0) {
continue;
}
diff --git a/storage/xtradb/handler/ha_innodb.cc b/storage/xtradb/handler/ha_innodb.cc
index 3130dc980d2..d2cd1951bd7 100644
--- a/storage/xtradb/handler/ha_innodb.cc
+++ b/storage/xtradb/handler/ha_innodb.cc
@@ -13272,6 +13272,17 @@ ha_innobase::defragment_table(
for (index = dict_table_get_first_index(table); index;
index = dict_table_get_next_index(index)) {
+ if (dict_index_is_corrupted(index)) {
+ continue;
+ }
+
+ if (index->page == FIL_NULL) {
+ /* Do not defragment auxiliary tables related
+ to FULLTEXT INDEX. */
+ ut_ad(index->type & DICT_FTS);
+ continue;
+ }
+
if (one_index && strcasecmp(index_name, index->name) != 0) {
continue;
}