diff --git a/storage/mroonga/ha_mroonga.cpp b/storage/mroonga/ha_mroonga.cpp index 3a85eaf18cd50..5db9aa0b5847d 100644 --- a/storage/mroonga/ha_mroonga.cpp +++ b/storage/mroonga/ha_mroonga.cpp @@ -938,6 +938,12 @@ static void mrn_default_tokenizer_update(THD *thd, struct st_mysql_sys_var *var, char **old_value_ptr = (char **)var_ptr; grn_ctx *ctx = &mrn_ctx; + if(!new_value) { + new_value = "off"; +#ifndef MRN_NEED_FREE_STRING_MEMALLOC_PLUGIN_VAR + new_value = mrn_my_strdup(new_value, MYF(MY_WME)); +#endif + } mrn_change_encoding(ctx, system_charset_info); if (strcmp(*old_value_ptr, new_value) == 0) { GRN_LOG(ctx, GRN_LOG_NOTICE, diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/variable_default_tokenizer_disable.result b/storage/mroonga/mysql-test/mroonga/storage/r/variable_default_tokenizer_disable.result new file mode 100644 index 0000000000000..45f1c7adddf39 --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/r/variable_default_tokenizer_disable.result @@ -0,0 +1,5 @@ +SET GLOBAL mroonga_default_tokenizer = NULL; +SHOW GLOBAL VARIABLES LIKE 'mroonga_default_tokenizer'; +Variable_name Value +mroonga_default_tokenizer off +SET GLOBAL mroonga_default_tokenizer = DEFAULT; diff --git a/storage/mroonga/mysql-test/mroonga/storage/t/variable_default_tokenizer_disable.test b/storage/mroonga/mysql-test/mroonga/storage/t/variable_default_tokenizer_disable.test new file mode 100644 index 0000000000000..63df372f3faae --- /dev/null +++ b/storage/mroonga/mysql-test/mroonga/storage/t/variable_default_tokenizer_disable.test @@ -0,0 +1,25 @@ +# -*- mode: sql; sql-product: mysql -*- +# +# Copyright (C) 2026 hadeer +# +# 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-1301 USA +--source include/not_embedded.inc +--source ../../include/mroonga/have_mroonga.inc + +SET GLOBAL mroonga_default_tokenizer = NULL; +SHOW GLOBAL VARIABLES LIKE 'mroonga_default_tokenizer'; +SET GLOBAL mroonga_default_tokenizer = DEFAULT; + +--source ../../include/mroonga/have_mroonga_deinit.inc