diff --git a/storage/mroonga/ha_mroonga.cpp b/storage/mroonga/ha_mroonga.cpp index 27f0b9bc11a53..46546905bda61 100644 --- a/storage/mroonga/ha_mroonga.cpp +++ b/storage/mroonga/ha_mroonga.cpp @@ -1710,6 +1710,7 @@ static bool mrn_parse_grn_index_column_flags(THD *thd, ER_MRN_INVALID_INDEX_FLAG_NUM, ER_MRN_INVALID_INDEX_FLAG_STR, invalid_flag_name); + break; } } return found; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_invalid.result b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_invalid.result new file mode 100644 index 0000000000000..0a1b92ee26275 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/create_table_index_flags_invalid.result @@ -0,0 +1,13 @@ +# +# MDEV-39479 Mroonga: avoid hang on invalid index flags +# +CREATE TABLE memos ( +content VARCHAR(64) NOT NULL, +FULLTEXT INDEX (content) COMMENT 'flags "COMPRESS_ZSTD"' +); +Warnings: +Warning 16508 The index flag 'COMPRESS_ZSTD' is invalid. It is ignored +SELECT mroonga_command("dump --dump_plugins no --dump_schema no"); +mroonga_command("dump --dump_plugins no --dump_schema no") +column_create memos#content index COLUMN_INDEX|WITH_POSITION memos content +DROP TABLE memos; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_invalid.test b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_invalid.test new file mode 100644 index 0000000000000..5542d178365f4 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/create_table_index_flags_invalid.test @@ -0,0 +1,34 @@ +# Copyright(C) 2026 +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA + +--echo # +--echo # MDEV-39479 Mroonga: avoid hang on invalid index flags +--echo # + +--source ../../include/mroonga/have_mroonga.inc +--source ../../include/mroonga/load_mroonga_functions.inc + +CREATE TABLE memos ( + content VARCHAR(64) NOT NULL, + FULLTEXT INDEX (content) COMMENT 'flags "COMPRESS_ZSTD"' +); + +SELECT mroonga_command("dump --dump_plugins no --dump_schema no"); + +DROP TABLE memos; + +--source ../../include/mroonga/unload_mroonga_functions.inc +--source ../../include/mroonga/have_mroonga_deinit.inc