Skip to content

Commit 12bfae0

Browse files
Bug#27912873 CRASH: SEGMENTATION FAULT IN HA_INNOBASE::INDEX_TYPE()
Problem: During ALTER, when adding foreign key on spatial index and the reference table does not exist then hit explict assert case in dict_table_check_for_dup_indexes(). Fix: Since foreign key is not allowed on spatial index. Added check inside dict_foreign_qualify_index(), if index->type is DICT_SPATIAL then return false. RB: 19968 Reviewed by : [email protected]
1 parent 3c8f903 commit 12bfae0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

storage/innobase/dict/dict0dict.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6728,6 +6728,11 @@ dict_foreign_qualify_index(
67286728
return(false);
67296729
}
67306730

6731+
if (index->type & DICT_SPATIAL) {
6732+
/* Spatial index cannot be used as foreign keys */
6733+
return(false);
6734+
}
6735+
67316736
for (ulint i = 0; i < n_cols; i++) {
67326737
dict_field_t* field;
67336738
const char* col_name;

0 commit comments

Comments
 (0)