Bug #67903 Error return without giving a log message
Description:
===================The Story===================
Different from other key-value configuration options in the option file (i.e., my.cnf), "!include" and "!includedir" do not use the separator "=". It's quite confusing (at least to me). The worst thing is when having the following invalid configuration entry:
!include = /etc/mysql/my.cnf.ext
The system just keeps silent when it met a read error. In my case, I changed the extended file a lot of times to let my setting take effect. But the problem is simply because mysqld fails to read the file "= /etc/mysql/my.cnf.ext" and fails silently.
Without a GDB tracing, it's impossible to know the root cause.
So I suggest to add a logging statement after the read error. It's always a good practice to do so. And the logging is at the startup time, which won't cause much performance overhead.
Thanks a lot!
Tianyin
How to repeat:
Leave the following configuration in your my.cnf:
#/etc/mysql/my.cnf
[mysqld]
!include = /etc/mysql/my.cnf.ext
basedir = /home/tianyin/mysql-5.5.28/usr/local/mysql
datadir = /home/tianyin/mysql-5.5.28/usr/local/mysql/data
...
Suggested fix:
--- ../mysql-5.5.28_org/mysql-5.5.28/mysys/default.c 2012-08-29 01:50:46.000000000 -0700
+++ mysys/default.c 2012-12-13 16:12:27.891494083 -0800
@@ -784,8 +784,11 @@
#if !defined(__WIN__)
{
MY_STAT stat_info;
- if (!my_stat(name,&stat_info,MYF(0)))
+ if (!my_stat(name,&stat_info,MYF(0))) {
+ fprintf(stderr, "Info: '%s' is ignored because it is not accessible\n",
+ name);
return 1;
+ }
/*
Ignore world-writable regular files.
This is mainly done to protect us to not read a file created by
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.038 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
Description: ===================The Story=================== Different from other key-value configuration options in the option file (i.e., my.cnf), "!include" and "!includedir" do not use the separator "=". It's quite confusing (at least to me). The worst thing is when having the following invalid configuration entry: !include = /etc/mysql/my.cnf.ext The system just keeps silent when it met a read error. In my case, I changed the extended file a lot of times to let my setting take effect. But the problem is simply because mysqld fails to read the file "= /etc/mysql/my.cnf.ext" and fails silently. Without a GDB tracing, it's impossible to know the root cause. So I suggest to add a logging statement after the read error. It's always a good practice to do so. And the logging is at the startup time, which won't cause much performance overhead. Thanks a lot! Tianyin How to repeat: Leave the following configuration in your my.cnf: #/etc/mysql/my.cnf [mysqld] !include = /etc/mysql/my.cnf.ext basedir = /home/tianyin/mysql-5.5.28/usr/local/mysql datadir = /home/tianyin/mysql-5.5.28/usr/local/mysql/data ... Suggested fix: --- ../mysql-5.5.28_org/mysql-5.5.28/mysys/default.c 2012-08-29 01:50:46.000000000 -0700 +++ mysys/default.c 2012-12-13 16:12:27.891494083 -0800 @@ -784,8 +784,11 @@ #if !defined(__WIN__) { MY_STAT stat_info; - if (!my_stat(name,&stat_info,MYF(0))) + if (!my_stat(name,&stat_info,MYF(0))) { + fprintf(stderr, "Info: '%s' is ignored because it is not accessible\n", + name); return 1; + } /* Ignore world-writable regular files. This is mainly done to protect us to not read a file created by