Commit 775aa6f0 authored by Aleksey Midenkov's avatar Aleksey Midenkov

MDEV-24403 Segfault on CREATE TABLE with explicit FTS_DOC_ID_INDEX by multiple fields

Ignore table->fts freed previously by create_table_info_t::create_table().
parent 82d39d43
...@@ -182,3 +182,13 @@ Table Op Msg_type Msg_text ...@@ -182,3 +182,13 @@ Table Op Msg_type Msg_text
test.t1 optimize status OK test.t1 optimize status OK
DROP TABLE t1; DROP TABLE t1;
SET GLOBAL innodb_optimize_fulltext_only= @optimize_fulltext.save; SET GLOBAL innodb_optimize_fulltext_only= @optimize_fulltext.save;
#
# MDEV-24403 Segfault on CREATE TABLE with explicit FTS_DOC_ID_INDEX by multiple fields
#
create table t1 (
f1 int, f2 text,
FTS_DOC_ID bigint unsigned not null,
unique key FTS_DOC_ID_INDEX(FTS_DOC_ID, f1),
fulltext (f2))
engine=innodb;
ERROR 42000: Incorrect index name 'FTS_DOC_ID_INDEX'
...@@ -106,3 +106,14 @@ SET GLOBAL innodb_optimize_fulltext_only= 1; ...@@ -106,3 +106,14 @@ SET GLOBAL innodb_optimize_fulltext_only= 1;
OPTIMIZE TABLE t1; OPTIMIZE TABLE t1;
DROP TABLE t1; DROP TABLE t1;
SET GLOBAL innodb_optimize_fulltext_only= @optimize_fulltext.save; SET GLOBAL innodb_optimize_fulltext_only= @optimize_fulltext.save;
--echo #
--echo # MDEV-24403 Segfault on CREATE TABLE with explicit FTS_DOC_ID_INDEX by multiple fields
--echo #
--error ER_WRONG_NAME_FOR_INDEX
create table t1 (
f1 int, f2 text,
FTS_DOC_ID bigint unsigned not null,
unique key FTS_DOC_ID_INDEX(FTS_DOC_ID, f1),
fulltext (f2))
engine=innodb;
...@@ -1709,7 +1709,7 @@ fts_drop_tables( ...@@ -1709,7 +1709,7 @@ fts_drop_tables(
error = fts_drop_common_tables(trx, &fts_table); error = fts_drop_common_tables(trx, &fts_table);
if (error == DB_SUCCESS) { if (error == DB_SUCCESS && table->fts) {
error = fts_drop_all_index_tables(trx, table->fts); error = fts_drop_all_index_tables(trx, table->fts);
} }
......
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