Skip to content
/ server Public
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 21 additions & 1 deletion storage/mroonga/ha_mroonga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,26 @@ static MYSQL_SYSVAR_ENUM(log_level, mrn_log_level,
static_cast<ulong>(mrn_log_level),
&mrn_log_level_typelib);

static int mrn_log_file_check(THD *thd, struct st_mysql_sys_var *var,
void *save, struct st_mysql_value *value)
{
MRN_DBUG_ENTER_FUNCTION();

int len;
const char *new_value= value->val_str(value, NULL, &len);

if (!new_value || len == 0)
{
my_printf_error(ER_MRN_INVALID_NULL_VALUE_NUM,
ER_MRN_INVALID_NULL_VALUE_STR, MYF(0),
"mroonga_log_file");
DBUG_RETURN(1);
}

*((const char **) save)= new_value;

DBUG_RETURN(0);
}
static void mrn_log_file_update(THD *thd, struct st_mysql_sys_var *var,
void *var_ptr, const void *save)
{
Expand Down Expand Up @@ -848,7 +868,7 @@ static void mrn_log_file_update(THD *thd, struct st_mysql_sys_var *var,
static MYSQL_SYSVAR_STR(log_file, mrn_log_file_path,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_MEMALLOC,
"log file for " MRN_PLUGIN_NAME_STRING,
NULL,
mrn_log_file_check,
mrn_log_file_update,
MRN_LOG_FILE_PATH);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SET GLOBAL mroonga_log_file = NULL;
ERROR HY000: NULL value can't be used for mroonga_log_file
SET GLOBAL mroonga_log_file = '';
ERROR HY000: NULL value can't be used for mroonga_log_file
SHOW GLOBAL VARIABLES LIKE 'mroonga_log_file';
Variable_name Value
mroonga_log_file groonga.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- mode: sql; sql-product: mysql -*-
#
# Copyright (C) 2026 hadeer <hadderramadan7@gmail.com>
#
# 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/mroonga/have_mroonga.inc
--source include/not_embedded.inc

--error 16505
SET GLOBAL mroonga_log_file = NULL;

--error 16505
SET GLOBAL mroonga_log_file = '';

SHOW GLOBAL VARIABLES LIKE 'mroonga_log_file';

--source ../../include/mroonga/have_mroonga_deinit.inc