1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-17093: SOURCE_REVISION in log and handle_fatal_signal

MariaDB MDEV-12583 added `SOURCE_REVISION` variable that exposes the
SHA1 of source code commit that the current running engine was built
from. This info is useful for troubleshooting and debugging.

This commit does the following:
- addes the `SOURCE_REVISION` value into engine error log.
- when a crash triggers handle_fatal_signal, the `SOURCE_REVISION` will
  be included in crash report.
- resolves MDEV-20344: startup messages belong in stderr/error-log not
  stdout

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license.  I am contributing on behalf of my employer Amazon Web
Services, Inc.
This commit is contained in:
Haidong Ji
2022-12-08 19:34:00 +00:00
committed by Daniel Black
parent 758c24dae2
commit af0ff8b455
2 changed files with 12 additions and 16 deletions

View File

@ -22,6 +22,7 @@
#include "mysqld.h"
#include "sql_class.h"
#include "my_stacktrace.h"
#include <source_revision.h>
#ifdef __WIN__
#include <crtdbg.h>
@ -177,7 +178,8 @@ extern "C" sig_handler handle_fatal_signal(int sig)
"something is definitely wrong and this may fail.\n\n");
set_server_version(server_version, sizeof(server_version));
my_safe_printf_stderr("Server version: %s\n", server_version);
my_safe_printf_stderr("Server version: %s source revision: %s\n",
server_version, SOURCE_REVISION);
if (dflt_key_cache)
my_safe_printf_stderr("key_buffer_size=%lu\n",