diff options
author | Sergei Golubchik <serg@mariadb.org> | 2021-12-09 19:14:17 +0100 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2021-12-10 09:40:50 +0100 |
commit | 0745db71798ea7179140f4ffe85d6d69c9ba7da6 (patch) | |
tree | 102da042125e51d698426f657d9bdf4b11b78e44 | |
parent | eafa2a1411d373fc21e82cc49cc1e6d7a33c127a (diff) | |
download | mariadb-git-0745db71798ea7179140f4ffe85d6d69c9ba7da6.tar.gz |
don't use buffered_option_error_reporter without perfschema
it's not printed, not cleaned up without perfschema,
so isn't supposed to be written into either
this fixes "Memory not freed" warnings when early command line
options produce warnings in non-perfschema builds
-rw-r--r-- | sql/mysqld.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index d7a44138780..6a7ea117c84 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -1392,12 +1392,13 @@ static MYSQL_SOCKET unix_sock, base_ip_sock, extra_ip_sock; struct my_rnd_struct sql_rand; ///< used by sql_class.cc:THD::THD() #ifndef EMBEDDED_LIBRARY +C_MODE_START +#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE /** Error reporter that buffer log messages. @param level log message level @param format log message format string */ -C_MODE_START static void buffered_option_error_reporter(enum loglevel level, const char *format, ...) { @@ -1409,6 +1410,7 @@ static void buffered_option_error_reporter(enum loglevel level, va_end(args); buffered_logs.buffer(level, buffer); } +#endif /** @@ -5809,7 +5811,7 @@ int mysqld_main(int argc, char **argv) Initialize the array of performance schema instrument configurations. */ init_pfs_instrument_array(); -#endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */ + /* Logs generated while parsing the command line options are buffered and printed later. @@ -5817,7 +5819,7 @@ int mysqld_main(int argc, char **argv) buffered_logs.init(); my_getopt_error_reporter= buffered_option_error_reporter; my_charset_error_reporter= buffered_option_error_reporter; -#ifdef WITH_PERFSCHEMA_STORAGE_ENGINE + pfs_param.m_pfs_instrument= const_cast<char*>(""); #endif /* WITH_PERFSCHEMA_STORAGE_ENGINE */ my_timer_init(&sys_timer_info); |