Commit e548d92b authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-17546 SPATIAL INDEX should not be allowed for FOREIGN KEY

dict_foreign_qualify_index(): Reject both FULLTEXT and SPATIAL
indexes. Remove these checks from the callers.

It is unclear whether this bug affected MariaDB Server.
FOREIGN KEY constraints on geometry column types could have
been rejected due to column type restrictions.
parent 8c9c583a
......@@ -3357,8 +3357,6 @@ dict_foreign_find_index(
while (index != NULL) {
if (types_idx != index
&& !(index->type & DICT_FTS)
&& !dict_index_is_spatial(index)
&& !index->to_be_dropped
&& !dict_index_is_online_ddl(index)
&& dict_foreign_qualify_index(
......@@ -6881,6 +6879,10 @@ dict_foreign_qualify_index(
return(false);
}
if (index->type & (DICT_SPATIAL | DICT_FTS)) {
return false;
}
for (ulint i = 0; i < n_cols; i++) {
dict_field_t* field;
const char* col_name;
......
......@@ -1343,8 +1343,7 @@ innobase_find_fk_index(
index = dict_table_get_first_index(table);
while (index != NULL) {
if (!(index->type & DICT_FTS)
&& dict_foreign_qualify_index(
if (dict_foreign_qualify_index(
table, col_names, columns, n_cols,
index, NULL, true, 0,
NULL, NULL, NULL)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment