Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
dd31e5c6
Commit
dd31e5c6
authored
Aug 26, 2016
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-9593 - Print the real version in the error log
parent
670760d5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
23 deletions
+30
-23
sql/mysqld.cc
sql/mysqld.cc
+28
-22
sql/mysqld.h
sql/mysqld.h
+1
-1
sql/signal_handler.cc
sql/signal_handler.cc
+1
-0
No files found.
sql/mysqld.cc
View file @
dd31e5c6
...
...
@@ -4340,11 +4340,23 @@ static int init_common_variables()
if
(
get_options
(
&
remaining_argc
,
&
remaining_argv
))
return
1
;
set_server_version
();
if
(
IS_SYSVAR_AUTOSIZE
(
&
server_version_ptr
))
set_server_version
(
server_version
,
sizeof
(
server_version
));
if
(
!
opt_abort
)
sql_print_information
(
"%s (mysqld %s) starting as process %lu ..."
,
my_progname
,
server_version
,
(
ulong
)
getpid
());
{
if
(
IS_SYSVAR_AUTOSIZE
(
&
server_version_ptr
))
sql_print_information
(
"%s (mysqld %s) starting as process %lu ..."
,
my_progname
,
server_version
,
(
ulong
)
getpid
());
else
{
char
real_server_version
[
SERVER_VERSION_LENGTH
];
set_server_version
(
real_server_version
,
sizeof
(
real_server_version
));
sql_print_information
(
"%s (mysqld %s as %s) starting as process %lu ..."
,
my_progname
,
real_server_version
,
server_version
,
(
ulong
)
getpid
());
}
}
#ifndef EMBEDDED_LIBRARY
if
(
opt_abort
&&
!
opt_verbose
)
...
...
@@ -8571,7 +8583,8 @@ static bool add_many_options(DYNAMIC_ARRAY *options, my_option *list,
#ifndef EMBEDDED_LIBRARY
static
void
print_version
(
void
)
{
set_server_version
();
if
(
IS_SYSVAR_AUTOSIZE
(
&
server_version_ptr
))
set_server_version
(
server_version
,
sizeof
(
server_version
));
printf
(
"%s Ver %s for %s on %s (%s)
\n
"
,
my_progname
,
server_version
,
SYSTEM_TYPE
,
MACHINE_TYPE
,
MYSQL_COMPILATION_COMMENT
);
...
...
@@ -9680,24 +9693,17 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
(MYSQL_SERVER_SUFFIX is set by the compilation environment)
*/
void
set_server_version
(
void
)
{
if
(
!
IS_SYSVAR_AUTOSIZE
(
&
server_version_ptr
))
return
;
char
*
version_end
=
server_version
+
sizeof
(
server_version
)
-
1
;
char
*
end
=
strxnmov
(
server_version
,
sizeof
(
server_version
)
-
1
,
MYSQL_SERVER_VERSION
,
MYSQL_SERVER_SUFFIX_STR
,
NullS
);
#ifdef EMBEDDED_LIBRARY
end
=
strnmov
(
end
,
"-embedded"
,
(
version_end
-
end
));
#endif
#ifndef DBUG_OFF
if
(
!
strstr
(
MYSQL_SERVER_SUFFIX_STR
,
"-debug"
))
end
=
strnmov
(
end
,
"-debug"
,
(
version_end
-
end
));
#endif
if
(
opt_log
||
global_system_variables
.
sql_log_slow
||
opt_bin_log
)
strnmov
(
end
,
"-log"
,
(
version_end
-
end
));
// This may slow down system
*
end
=
0
;
void
set_server_version
(
char
*
buf
,
size_t
size
)
{
bool
is_log
=
opt_log
||
global_system_variables
.
sql_log_slow
||
opt_bin_log
;
bool
is_debug
=
IF_DBUG
(
!
strstr
(
MYSQL_SERVER_SUFFIX_STR
,
"-debug"
),
0
);
strxnmov
(
buf
,
size
-
1
,
MYSQL_SERVER_VERSION
,
MYSQL_SERVER_SUFFIX_STR
,
IF_EMBEDDED
(
"-embedded"
,
""
),
is_debug
?
"-debug"
:
""
,
is_log
?
"-log"
:
""
,
NullS
);
}
...
...
sql/mysqld.h
View file @
dd31e5c6
...
...
@@ -774,7 +774,7 @@ inline void dec_thread_running()
thread_safe_decrement32
(
&
thread_running
);
}
extern
void
set_server_version
(
void
);
extern
void
set_server_version
(
char
*
buf
,
size_t
size
);
#if defined(MYSQL_DYNAMIC_PLUGIN) && defined(_WIN32)
extern
"C"
THD
*
_current_thd_noinline
();
...
...
sql/signal_handler.cc
View file @
dd31e5c6
...
...
@@ -107,6 +107,7 @@ extern "C" sig_handler handle_fatal_signal(int sig)
"diagnose the problem, but since we have already crashed,
\n
"
"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
);
if
(
dflt_key_cache
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment